Pages

Sunday, August 23, 2015

How to change the “Add to Cart” button name in OpenCart 2.x

One of the ways to make your store more unique and interesting is to change some of the text strings that are common for all online stores. This is why in this article we will show you how to change the “Add to Cart” text to something different.

How?

Changing the button name is actually quite easy. You just have to change the language string for that phrase and you are good to go. I will show you how to do this step by step. In the following example we will change the “Add to Cart” string for the English language, but this way is applicable for all languages on your store. Lets go!
  1. Access your store’s files.
  2. Navigate to catalog/language/english/english.php.
  3. Find the following string:
    1$_['button_cart'] = 'Add to Cart';
  4. Replace it with:
    1$_['button_cart'] = 'Get it!';
  5. That’s it!
In the example above, we are changing the phrase with “Get it!”, but you can change it to whatever you want it to be. By doing this change, you will modify the string globally and it will not matter what template you are using, as long as the button text is not hardcoded in it.
This approach was tested on OpenCart 2.x, but it should also work for OpenCart 1.5.x, because the language structure of both systems is the same.

In Conclusion

As you can see, making this change is easy and effortless and it is not just that - you can check out all strings in that file and change not only this string, but all of them if you like. If you have any questions, let us know in the comments section below.

No comments:

Post a Comment