Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1262711
    huylam1
    Participant

    Hi,

    Can you tell me how to change the text and link (I’d like to link to a different page) to the Add to Cart button on the individual product page in Woocommerce. I’ve been able to change it on the summary page on the functions.php file in my child theme, but no success on the individual product page. Here is my URL: http://naokokamura.ca/toeezy/product/toe-ezy-dark-grey/

    Thank you.

    #1263007
    Jade
    Moderator

    Hi there,

    Please add this code in the functions.php file of the child theme to change the text:

    
    add_filter( 'woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text' );    // 2.1 +
     
    function woo_archive_custom_cart_button_text() {
     
      return __( 'My Button Text', 'woocommerce' );
     
    }

    Would you mind pointing out where you want the users to be redirected after they hit the add to cart button?

    Thank you.

    #1263787
    huylam1
    Participant

    Hi there,

    I’d like it to point to a product page on amazon.

    Thank you.

    #1263791
    huylam1
    Participant

    Hi there,

    I just added that code in the child theme’s functions.php and it didn’t change anything. Please advise.

    Thanks

    #1264066
    Rue Nel
    Moderator

    Hello There,

    Would you mind providing us the url of your site with login credentials so we can take a closer look and fix the issue?

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

    #1264085
    huylam1
    Participant
    This reply has been marked as private.
    #1264150
    Thai
    Moderator

    Hi There,

    Please change your product type to External/Affiliate product after that you can edit the button text & the link:

    http://i.imgur.com/g3xXOev.png

    For more information, please take a look at this article: https://code.tutsplus.com/articles/the-beginners-guide-to-woocommerce-adding-an-externalaffiliate-product–cms-22755.

    Regards!

  • <script> jQuery(function($){ $("#no-reply-1262711 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>