Changing 'Select Options' button under product to something else

This topic has 4 replies, 3 voices, and was last updated 7 years, 10 months ago ago by Eva Kemp

  • Avatar: onetwovee
    onetwovee
    Participant
    January 11, 2017 at 14:50

    Is there a way to change the words ‘Select Options’ to ‘More Colours’?

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    January 11, 2017 at 15:12

    Hello,

    Please refer to Woocommerce documentation:
    https://docs.woothemes.com/document/change-add-to-cart-button-text/

    Regards,
    Rose Tyler.

    Avatar: onetwovee
    onetwovee
    Participant
    February 16, 2017 at 09:17

    Hi, this solution changes ALL the ‘Add to Cart’ buttons, but I’m looking to only change the text for the items with multiple variations. Is there a way to do this?

    Avatar: Eva
    Eva Kemp
    Support staff
    February 16, 2017 at 13:31

    Hello,

    Please add this code in functions.php file:

    add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
    /**
     * custom_woocommerce_template_loop_add_to_cart
    */
    function custom_woocommerce_product_add_to_cart_text() {
    	global $product;
    	
    	$product_type = $product->product_type;
    	
    	switch ( $product_type ) {
    		case 'variable':
    			return __( 'More Colours', 'woocommerce' );
    		break;
    		}
    	}

    Regards,
    Eva Kemp.

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.