Last active
August 29, 2015 13:59
-
-
Save craiggrella/10580419 to your computer and use it in GitHub Desktop.
Change Add to Cart Text on WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change the add to cart text on single product pages | |
* via Remi Corson on wpexplorer: http://www.wpexplorer.com/best-woocommerce-snippets-wordpress/ | |
*/ | |
function woo_custom_cart_button_text() { | |
return __('My Button Text', 'woocommerce'); | |
} | |
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text'); | |
/** | |
* Change the add to cart text on product archives | |
*/ | |
function woo_archive_custom_cart_button_text() { | |
return __( 'My Button Text', 'woocommerce' ); | |
} | |
add_filter( 'add_to_cart_text', 'woo_archive_custom_cart_button_text' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment