Changing the button text - by henriklm - on WordPress WooCommerce support

This topic has 4 replies, 2 voices, and was last updated 3 years, 9 months ago ago by Olga Barlow

  • Avatar: henriklm
    henriklm
    Participant
    June 29, 2020 at 12:56

    Hi

    I can’t seem to figure out where I can change the button text “Select Options” as seen in the attached image.

    https://urbanjewls.com/wp-content/uploads/2020/06/Skærmbillede-2020-06-29-kl.-13.51.17.png

    3 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 29, 2020 at 13:04

    Hello,

    Either use translation files of the WooCommerce plugin and instead of the translation just edit the text to what you need. Or use child theme and add the following code to child theme functions.php

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

    Regards

    Avatar: henriklm
    henriklm
    Participant
    June 29, 2020 at 13:21

    Thanks for the fast respond but it gives me an error when i add it to the functions.php and when i try to change the string in Loco Translate it does not apply. So what can i do?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 29, 2020 at 16:39

    Hello,

    Provide us with temporary WP Dashboard access to your site and tell me what should be instead of the default “Select Options”? I’ll check and try to help you.

    Regards

  • 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.