I am using a filter to change a label on a particular page and set the rest the same.
add_filter( 'woocommerce_product_single_add_to_cart_text', 'themeprefix_cart_button_text' );
//Add New Pay Button Text
function themeprefix_cart_button_text() {
if(is_page(3601)) :
return __( 'Buy Now', 'woocommerce' );
else:
return __( 'Add To Cart', 'woocommerce' );
endif;
}
But not working - anything wrong with the conditional code?
3601
is correct, and that the product is a single product? Alsois_page()
will be checking the ID of the page you're viewing, not the ID of the product whose text you're changing. Is that your intention?