Skip to content

Instantly share code, notes, and snippets.

@fender841
Last active December 15, 2015 11:49
Show Gist options
  • Save fender841/5255958 to your computer and use it in GitHub Desktop.
Save fender841/5255958 to your computer and use it in GitHub Desktop.
Changing add_to_cart button text on single product pages and category view pages.
//For changing add-to-cart button text on single product pages.
add_filter('single_add_to_cart_text', 'single_cart_button_text', );
function single_cart_button_text() {
return __('Add to order', 'woocommerce');
}
//For changing add-to-cart button text on category view pages
add_filter('add_to_cart_text', 'category_cart_button_text', );
function category_cart_button_text() {
return __('custom text', 'woocommerce');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment