Skip to content

Instantly share code, notes, and snippets.

@themepaint
Created January 28, 2018 04:16
Show Gist options
  • Save themepaint/62251001807f3f146cbbd5be8d4314dd to your computer and use it in GitHub Desktop.
Save themepaint/62251001807f3f146cbbd5be8d4314dd to your computer and use it in GitHub Desktop.
Woocommerce cart change by putting the code in functions.php
//archive page or main page
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_product_add_to_cart_text_themepaint' ); // 2.1 +
function woo_custom_product_add_to_cart_text_themepaint() {
return __( 'Buy it on ebay', 'woocommerce' );
}
//product single page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text_themepaint' ); // 2.1 +
function woo_custom_single_add_to_cart_text_themepaint() {
return __( 'Buy it on ebay', 'woocommerce' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment