I am trying to change the Add To Cart text on the product page button to Buy Now
I’ve tried using the function that’s being posted everywhere to solve the issue but somehow that doesn’t seem to do the trick, also using a WordPress plugin is not changing the text.
So far I’ve found the following function
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
Adding that to my Code Inserter creates an error and breaks the website.
I think that Divi is overruling the function from somewhere. Any tips or ideas?