Advertisement
fahimmurshed

Change "Add to cart" text strings forcefully

Mar 4th, 2021
1,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. // To change add to cart text on single product page
  2. add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
  3. function woocommerce_custom_single_add_to_cart_text() {
  4.     return __( 'Buy Now', 'woocommerce' );
  5. }
  6.  
  7. // To change add to cart text on product archives(Collection) page
  8. add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );  
  9. function woocommerce_custom_product_add_to_cart_text() {
  10.     return __( 'Buy Now', 'woocommerce' );
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement