It may be the case that the Add to cart button text does not suit your product or web shop. With a few lines of code you can easily change this text. In this short tutorial, I will show you how. You can adjust the Add to cart button text for the whole WooCommerce web shop, or for a single category only.
Change add to cart button text
To change the button text, add the following snippet to your theme’s functions.php
With this snippet, you can easily change the Add to cart button text on single pages into (for instance) Buy Product. If you want to adjust the button text on archive pages as well, you additionally have to add the following snippet to your theme’s functions.php.
Change add to cart button text per category
But … what if you want to change the button text for only one or two categories? No worries, I’ve got that covered too.
First thing, you have to locate the slugs of the categories you want to change the text for. Navigate to Products > Categories. In this example, I use the slug of the category clothing.
Next, you have to add this snippet to your functions.php. On line 19, you see that I’ve added the slug clothing. When an article is in the category with the slug clothing, the button text will be Order your Clothes. The default text will be Order now.
Using this snippet, you are able to change the Add to cart button text on single pages into Order your Clothes. If you also want to change the button text on archive pages, you additionally have to add the following snippet to your theme’s functions.php.
Change add to cart button text for more then one category
It’s possible to add a unique order button for every category. To do that, simply extent the snippets above with extra ‘cases’, such as hoodies and music.
That’s all, folks. I hope it’ll be useful for one of your upcoming projects.