How to change Add to cart button text? Woocommerce

Total 9 users online

Most users ever online were 103, on 18 Sep 2021 @ 7:46 am

How to change Add to cart button text? Woocommerce

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.

STEPS TO CHANGE DEFAULT ADD TO CART TEXT

  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
  4. Save the changes and check your website. The custom text in add to cart button should show up now.
				
					
// 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' );
}
				
			
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on skype
Skype
Share on telegram
Telegram
Share on whatsapp
WhatsApp
Share on email
Email
Share on print
Print
Need Help? Chat with me
Please accept our privacy policy first to start a conversation.