Created
February 27, 2016 12:23
-
-
Save OscarAbadFolgueira/d12dde0bf7885083ef61 to your computer and use it in GitHub Desktop.
WordPress WooCommerce Snippet that change the text "Add to cart".
This file contains 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
<?php | |
/** | |
* This WordPress / Woocommerce code snippet change the "Add to cart" text. | |
* | |
* Author: Oscar Abad Folgueira | |
* Author URI: http://www.oscarabadfolgueira.com | |
* | |
* You can copy this snippet and paste in your functions.php or you can build your own plugin | |
* | |
* Change the text for your needs. | |
*/ | |
// change "Add to cart" text in category pages | |
add_filter( 'woocommerce_product_add_to_cart_text', 'oaf_wc_change_add_to_cart_text' ); | |
// change "Add to cart" text in single product pages | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'oaf_wc_change_add_to_cart_text' ); | |
function oaf_wc_change_add_to_cart_text() { | |
return __('¡Comprar Ya!', 'woocommerce'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment