This questions arises when you want to change default text of a Add To Cart button on your WooCoomerce website. Sometimes you want to change default text to “Donate Now” or any other text then this snippet will help you to change the text of the button.

Follow these instructions

  1. Add following lines of code inside your current active themes functions.php file. You can find this file at /wp-content/themes/active-theme-folder-name/functions.php
add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text');
function woo_custom_cart_button_text() {
return __('Buy Now', 'woocommerce');
}