• Hi Marc,
    I have another question: it’s possible to change the text in the “add to cart” button?
    I changed it in te product page of my Woocommerce, but inside the configurator page the button has the old text.

    Thank you very much!!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    Sorry I missed your message! Have you managed to find a solution?

    Marc

    Ty

    (@tyranthacker)

    Yes please, how would you change “Add to Cart” text ?

    Ty

    (@tyranthacker)

    After a little bit of scanning and searching the plugin files… I figured it out.
    I think this is correct. It works for me.

    This will change it on all WooCommerce pages too..
    Use a child theme functions.php

    add_filter( 'woocommerce_product_single_add_to_cart_text', 'ql_replace_add_to_cart_button_text' );
    add_filter( 'woocommerce_product_add_to_cart_text', 'ql_replace_add_to_cart_button_text' );
    add_filter( 'mkl_pc/add_to_cart_button/default_label', 'ql_replace_add_to_cart_button_text' );
    //Replace Add to Cart text with Buy Now! 
    function ql_replace_add_to_cart_button_text() {
     return __( 'Purchase', 'woocommerce' );
    }
    Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    You can also use this filter to only change the text in the configurator:

    add_filter( 'mkl_pc/add_to_cart_button/label', function() {
        return 'New add to cart label';
    } );

    Marc

    Ty

    (@tyranthacker)

    Thanks mark, that code you sent returned an error.

    syntax error, unexpected ''mkl_pc/add_to_cart_button/def' (T_CONSTANT_ENCAPSED_STRING), expecting ')'

    Plugin Contributor Marc Lacroix

    (@marcusig)

    That looks like there was an issue in the copy / paste.
    I’ve retested the code and added the code to a gist to ensure formatting:
    https://gist.github.com/marcusig/6a63106f8b55b40547a3573792cb46f0

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change Add to cart button’ is closed to new replies.