Change Select Options Text in WooCommerce Plugin

Changing the “Select Options” Text in WooCommerce is quite simple:

First we’re going to assume that you’re using a child theme or the Code Snippets plugin in your WooCommerce site.

Next we’re going to add the following code to your site: (again, do NOT put this in your main theme’s files!):

add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) {
	global $product;
	if ( $product->is_type( 'variable' ) ) {
		$text = $product->is_purchasable() ? __( 'Custom options text', 'woocommerce' ) : __( 'Read more', 'woocommerce' );
	}
	return $text;
}, 10 );

Now, see the part that says ‘Custom options text’?

Also, see the part that says ‘Read more’ as well?

Replace that text with the text you would like.

Be absolutely sure that you do not modify or delete the surrounding single quote ‘

If you do accidently remove one of those quotes, remember that those quotes are not the one at the top left of your keyboard, but instead, that is the quote that is normally directly between your right pinky and the enter button.

 

Your Voice Matters! Share Your Thoughts!!

This site uses Akismet to reduce spam. Learn how your comment data is processed.