make modification of add_to_cart button specific to single page

Question

I am using woocomemrce for the ecommerce part of my wordpress site.

When using the add_to_cart button i want it to say “read more” on a specific webpage only.
So far i have found the code to change the button text:

add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text');

function woo_custom_cart_button_text() {
return__('Read More','woocommerce'); }

The question is, how do I make this apply to the appearance of the add_to_cart button on a single page of my website? The page is not a shop page. It is a normal webpage where is have description of products and the associated treatment. The button is there to take them to the product page.

Thank you

0
, , Jack Borg-Cardona 4 years 2020-06-04T08:10:37-05:00 0 Answers 93 views 0

Leave an answer

Browse
Browse