If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

WooCommerce. How to change “Add to cart” button text

This tutorial is going to show you how to change the default text of the "Add to cart" button on your WooCommerce template.

WooCommerce. How to change “Add to cart” button text

  1. On your FTP go to the wp-content\themes\theme#####\includes directory (where ##### is your template number).
  2. Find custom-function.php file and open it for editing.
  3. Scroll down and add the following code before ?>

    To change add to cart text on single product pages:

    woocommerce_add_to_cart_button_text_changing_1

    add_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' );                // < 2.1
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text' );  // 2.1 +
     
    function woo_custom_single_add_to_cart_text() {
     
        return __( 'My Button Text', 'woocommerce' );
     
    }
    

    To change add to cart text on product archives:

    woocommerce_add_to_cart_button_text_changing_2

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

    (where 'My Button Text' is the new name of your "Add to cart" button)

  4. Save the changes and check your website. The new name of the button should show up now.

Feel free to check the detailed video tutorial below:

WooCommerce. How to change "Add to cart" button text