Customize the Add to Cart button text in woocommerce so that you can take control over what the add to cart button reads for your particular ecommerce store, by simply adding a simple block of PHP to your functions.php file.

*Note: This will change all of your “Add to Cart” buttons throughout your store to the new text you apply.

Using an FTP program or command line, access your functions.php file inside your wordpress theme’s directory.

Now that you have your functions.php file, open it in your code editor of choice and add the following line of code to the bottom of it:

add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );
function woo_custom_cart_button_text() {
return __( 'My Button Text', 'woocommerce' );
}

Now that you have this block of PHP added to your file, have a look at the line of code on line 6 in the example. The part that actually changes the text is ‘My Buttom Text’. Change the text here (between the quotes) to get exactly what you would like your add to cart button to read. For example:

add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );
function woo_custom_cart_button_text() {
return __( 'My New Button text!', 'woocommerce' );
}

Using the block above, my Add to Cart button would now read My New Button Text!

Once you have your custom text typed in and ready, save the file, and make sure your website is now using this modified functions.php file.

Summary
Article Name
Customize the Add to Cart Button Text in Woocommerce
Description
Take control over what the add to cart button reads for your particular ecommerce store, by simply adding a simple block of PHP to your functions.php file.
Author