Change “Add to Cart” Button Text in WooCommerce
Did you know that you can change the text on the “Add to Cart” button in WooCommerce? It’s a small change, but it can make a big difference in how customers interact with your site. In this post, we’ll show you how to customize the text on the “Add to Cart” button.
Changing the default text is suitable for different countries for example, for Spain could be “AƱadir al carrito” and for Germany “In den Warenkorb”.
There are 2 places you need to modify the text: on a single product page and its archive pages.
// 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 __( 'Add to Basket', 'woocommerce' ); }
// To change add to cart text on product archives 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 __( 'Add to Basket', 'woocommerce' ); }