Skip to content

Instantly share code, notes, and snippets.

@dr5hn
Created October 15, 2017 08:11
Show Gist options
  • Save dr5hn/1725d42f3857529afa89f764e1a80515 to your computer and use it in GitHub Desktop.
Save dr5hn/1725d42f3857529afa89f764e1a80515 to your computer and use it in GitHub Desktop.
WooCommerce - How to Change Add to Cart Button Text in Wordpress
<?php
//WooCommerce. How to change “Add to cart” button text -- By Darshan Gada
add_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); // < 2.1
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +
function woo_custom_cart_button_text() {
return __( 'ADD TO BASKET', 'woocommerce' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment