I’m trying to change the text of the “add to cart” button to “Full sale” when on the shopping cart page “sign up now” on product ID 4968 and be a “Book” everywhere.
Here is my code in the functions.php file:
function woo_custom_cart_button_text() {
if (is_single('Product1')) {
return __( 'Subscribe Now', 'woocommerce' );
} else {
return __( 'Book', 'woocommerce' );
}
}
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );
source
share