[SOLVED] How To Change WooCommerce Button Text

Andrei Iordache

Andrei Iordache

WordPress Developer

­čÜÇ I Help People Get Found Online | WordPress Development, Core Web Vitals, Security&Maintenance

How To Change “Add to Cart” to “Buy Now” WooCommerce Button Text

 

Hello! Today I will teach you how to change the WooCommerce “Add to Cart” button text to “Buy Now” or whatever you want to. For this, you have at least two options:

BEFORE ANYTHING, DO A FULL BACKUP OF YOUR SITE. RIGHT NOW! 

OK, so assuming you did a full backup of your site, in order to change the “Add to Cart” button text to “Buy Now / Order / Hire Me / and so on”, you must add the following PHP code into your theme:

// Change the Add To Cart Button Text on the 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' ); 
}

// Change the Add To Cart Button Text on the 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' );
}

Option 1: Changing the WooCommerce Button Text From The Main Theme:

WP-Dashboard -> Appearance -> Main Theme (the active one) -> Theme editor -> (locate the functions.php file) -> Add the PHP code from above at the bottom of the functions.php page -> Save the file.

If the change doesn’t seems to appear, try to clean your browser cache.


Option 2: Changing the WooCommerce Add to Cart Button Text From The Child Theme (SAFEST METHOD):

This is the safest method, because anytime you’ll update the theme your are using on your WordPress site, the configurations you applied on your site will still be there. If you apply tweaks on the main theme, once you’ll update it, you may lose those tweaks.

Assuming you have the Child Theme activated, go to: WP-Dashboard -> Appearance -> Child Theme (the active one) -> Theme editor -> Functions.php (in fact, I think this is the only file you should see on the child theme) -> Add the PHP code.


Cannot Find The Child Theme Editor In The Dashboard

If you cannot locate the functions.php from the admin dashboard, you can try the following thing:

Go to cPanel -> File Manager -> Public HTML (or the folder where your WordPress Site’ s files are stored) -> WP Content -> Themes -> Theme_Folder (best is to go to Child_Theme_Folder) -> You should see the functions.php there. Open with an editor, paste the code above and save it.

Submit Your Guest Post

Previous Post
How To Cancel LinkedIn Premium Account In 5 Simple Steps
Next Post
[SOLVED] WooCommerce Mini Cart Not Update
Lusi StudiosLusi Studios
15:32 22 Jun 22
Andrei did an amazing job! He helped in a very rushed time and he excelled at everything. Thanks again!
I am grateful and I would to thank Websites Seller for their support in site recovery and site transfer. Websites Seller just saved my business. Thank you!
Wouter GhysensWouter Ghysens
11:52 10 Sep 21
Looking for a Wordpress transfer from site A to site B, I found back Andrei from Wesites Seller on Google.He was very proactive in his approach, came with hundreds of ideas and lifetime experiences from other migrations. He knows the wordpress, the hosting and php database as the back of his pocket.And we worked out this migration very smooth. Together we solved it, and myself and my business are very pleased with his approach.100% recommendation & kudo's from out of Belgium!
Ioachim CiobanuIoachim Ciobanu
18:39 14 Jul 21
Websites Seller built my resume site. Deliverables were quickly completed, and I was asked for my feedback at each stage of development. All feedback I gave was implemented in a short time.Another great thing is that he comes with smart solutions, regarding stuff which I didn't initially think of (site security, Google site speed optimization and so on). Basically, he was great, staying in touch, keeping me updated and paid attention to what was most important for my site.Overall, I am very happy with the work done. I highly recommend this developer!
K CollinsK Collins
09:11 19 May 21
I needed help with website speed - to improve my core web vitals - without compromising the usability of my site. Andrei was extremely responsive, proactive and fast. And more importantly, he increased by website speed. Highly recommend him, and I will be using him going forward on all my projects.
js_loader

Submit Your Guest Post

Services

WordPress Website Maintenance Services

WordPress Maintenance Services

WordPress website maintenance service that provides cloud backups, emergency support, weekly website updates, speed and many more.

sally

WordPress Migration Service

Safely transfer your WordPress website to a new location for $75. … Migrate your website to its new host.

lawyer-office

Lawyer Web Design

We specializes in website design, Internet marketing and SEO for lawyers and attorneys throughout the Europe and US.