Categories

Featured templates

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

Norman Fisher July 7, 2014
Rating: 4.8/5. From 5 votes.
Please wait...

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
This entry was posted in WooCommerce Tutorials and tagged add, cart, change, text, title, to, WooCommerce. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket