Saturday, December 23, 2017

Wordpress - Change 'Add to cart' button text

Please add the below code to code the 'Add to cart' button text.

Change in Product Catalogue Page:
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text' );
function woo_archive_custom_cart_button_text() {
return __( 'ADD TO CART', 'woocommerce' );
}


Change in Single Product Page:
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 CART', 'woocommerce' );
}

No comments: