Website Design Dublin & Software Solutions By Arrow Design

New Address : The Chase, Sandyford, Dublin 18

Same great service, great coffee and easy to get to!

We GET Business

Change Add To Cart Text

Are you looking for a way to change the default “Add to cart” button text in WooCommerce? This code snippet will let you change the text to “Buy Now“, “Add to Bag“, “Book Now“, or whatever custom text you like.

To do this you need to:

  1. Open WordPress admin panel, go to Appearance > Theme Editor.
  2. Open functions.php theme file.
  3. Add the following code at the bottom of function.php file of your child theme.
  4. Save the changes and check your website. Note that you can change the text included from ‘Buy Now’ to whatever you wish. The custom text in add to cart button will now be displayed.

Note:

To change the add to cart button, ensure that you take a backup and only do this through your child theme so that future updates to your theme will not overwrite the code.

//START OF CODE

// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' ); 
function woocommerce_custom_single_add_to_cart_text() {
    return __( 'Buy Now', 'woocommerce' ); 
}
// To change add to cart text on product archives(Collection) page add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' ); function woocommerce_custom_product_add_to_cart_text() { return __( 'Buy Now', 'woocommerce' );

//END OF CODE

 

If you would prefer to change the ADD TO CART butting do this via a plugin, please contact us and we will happily provide, for free 🙂

 

 

Social Media

 

Payments Accepted

 

payment options

Request a Callback

 

Contact Details

Phone: 01 536 3049

Mobile: (087) 13 77 382

Email: info@arrowdesign.ie

Address:

The Chase, Arkle Rd,

Sandyford, Dublin 18,

D18 Y3X2

 

Pin It on Pinterest

Share This