In WooCommerce, variable products display a “Select options” button on the shop and category pages instead of “Add to cart”. This is default behavior because variable products require customers to choose attributes (such as size or color) before adding them to the cart.
However, in some cases, you may want to change the “Select options” button text to something more conversion-friendly like “View Product”, “Choose Options” or even “Add to Cart”.
By default, WooCommerce does not provide a built-in setting to change this text but it can be easily customized using a simple PHP snippet.
Snippet 1: Change “Select Options” Button Text on Shop & Archive/Category Pages
Use the following snippet to change the Select options button text for variable products on the shop and product archive/category pages:
// Change Select Options Button Text on Shop & Archive Pages
add_filter( 'woocommerce_product_add_to_cart_text', 'shez_change_select_options_text', 9999, 2 );
function shez_change_select_options_text( $text, $product ) {
if ( $product->is_type( 'variable' ) ) {
return esc_html__( 'View Product', 'woocommerce' );
}
return $text;
}Snippet 2: Change “Select Options” to “Add to Cart”
If you want to replace Select options with Add to Cart, update the return text:
// Change Select Options Button Text on Shop & Archive Pages
add_filter( 'woocommerce_product_add_to_cart_text', 'shez_change_select_options_text', 9999, 2 );
function shez_change_select_options_text( $text, $product ) {
if ( $product->is_type( 'variable' ) ) {
return esc_html__( 'Add to Cart', 'woocommerce' );
}
return $text;
}⚠️ Note: This only changes the label. Customers will still be redirected to the product page to select variations.
Where to add this custom code?
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin.
Related Snippets:
About Sheraz Ghani
Hey, I’m Sheraz, a WordPress developer who codes every day, and I share what I learn so other developers don’t have to figure it out the hard way.
Shez.dev is where I document useful WordPress code snippets, troubleshooting guides and developer tutorials.
Need some developer help? Contact me