In this article, I’ll show you how you can change WooCommerce’s “Add to cart” button text with snippets.
Pest this code on your function.php file.
/**
* Changing WooCommerce Add to Cart Text
*/
add_filter('woocommerce_product_single_add_to_cart_text', function() {
$text = 'Buy eBook'; // Change "Buy eBook" to your text.
return __($text, 'woocommerce');
});
Make sure you have changed your “Buy eBook” text as per your requirements.
That’s all. I hope this article helped you understand How to change WooCommerce “Add to cart” text with outstanding snippets.


