Woocommerce : Changing “Cart” word to “Toolbox” throughout Website

Question: How to change all instances of “Cart” word to “Toolbox” throughout Website in WooCommerce.

Answer:

The easiest way to do this is too create/edit a WooCommerce language file.

Here are steps to do so,

  1. First of all go to directory,[wordpress]/wp-content/plugins/woocommerce/i18n/languagesYou see 2 files:woocommerce.pot
    woocommerce-admin.potThese are language files and we need to edit them. These contain the strings used in the front end and the admin side respectively.
  2. Copy these two files to somewhere to edit( we doesn’t want to modify core files)
  3. Download  and install Poedit
    We can create/edit language files using  Poedit a translations editor, which we can use for WordPress.
  4. Open the file woocommerce.pot (which is used for Front end ) in Poedit
  5. Select option “Create new translation”
  6. Select the language you want the translation file in ( in this case English UK )
  7. Find the word throughout the file (using find command i.e Cntrl + F )
  8. Adding a translation where you find instances of “cart” . e.g. “Add to Cart’”, create a translation “Add to Toolbox”.
  9. Do these steps recursively until there is no word found.
  10. When you done, save the file as woocommerce-en_GB.po . This will create 2 language files for woocommerce (woocommerce-en_GB.po and woocommerce-en_GB.mo )
  11. Now go to your website and in wp-content, create a folder called languages (if one doesn’t exist already) and inside languages folder create new one called woocommerce
    so you have [wordpress]/wp-content/languages/woocommerce
  12. Its in this folder that we need to put the woo language files (created in step 4) that will override the default WooCommerce language file (if one exists for UK english).
    So drop woocommerce-en_GB.po and woocommerce-en_GB.mo in the WordPress directory:
    [wordpress]/wp-content/languages/woocommerce
  13.  That’s It, have a fun.
  14. Look at your website and see how all the places that Cart appeared have changed to Toolbox.

When ever you update WooCommerce plugin, your files remains unchanged.

References:

Step1Step2  step3 Step4

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s