If you have been looking for a way to change Add to cart button text in wooCommerce in Divi Theme, this code will let you change the text to anything you want.
To be able to change the text, follow the steps below:
- Go to WordPress admin dashboard.
- Then go to Appearance > Theme Editor.
- Open functions.php file.
- Add the code below at the bottom of the function.php file.
// 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’ );
}
Save the changes, then check your website if the text button has changed.
Alternatively, you can use the WordPress plugin called Code Snippet to add the code.
I hope this helps.
That’s it for now. To be able to receive more of these tips. Subscribe to our YouTube channel.





Working Perfect
I’m glad the tutorial helped.