WooCommerce lets you build e-commerce sites with WordPress. WooCommerce Multilingual makes it fully compatible with WPML.
What you’ll need:
- WooCommerce 2.0.x; or WooCommerce 1.x (preferably 2.0.x).
- WooCommerce Multilingual
- A recent version of WPML, including the String Translation and Translation Management modules. WooCommerce support is available from version 2.6.0 and above
Now that you have all plugins installed and activated, you can start setting up your multilingual store.
To get started, complete the set up process for WPML (select active languages and your site’s default language, add a language switcher, and decide on a permalink structure for multilingual pages, among other settings); and for WooCommerce, in particular create the store pages and review and select other WooCommerce settings.
When you are done with the setup, these are the tasks that you will most likely need to carry out (click on the links to jump to each section):
- Translate store pages: ‘shop’, ‘cart’, checkout’, etc., provided by WooCommerce.
- Translate products: title, description, etc.
- Translate product categories: ‘sportswear’, ‘casual’, …
- Translate product attributes and product variations: Attributes such as ‘size’, ‘colour’, ‘model’, can be used to define product variations with different prices, stock, etc.
- Translate other texts: such as shipping methods, taxes, and other strings from your theme and plugins.
WPML will automatically load and use each active plugin’s localization (.po) files for translation (including WooCommerce’s files, so most store texts –’add to cart’, ‘select options’, etc.– will be automatically translated for you from the start), but these are often incomplete. You can easily complete the missing translations with WPML->String Translation, following the WPML documentation for Theme and Plugin Localization.
You may also optionally want to (click on the links to jump to each section):
- Translate product slugs: An experimental feature that allows you to use translated permalinks, so that you can have both /product/product-1 and /producto/producto-1.
- Enable multicurrency options: Options that allow you to either manually enter different prices for different languages and currencies, or compute them automatically depending on language based on exchange rates you set.
- Handle Inventory, Emails and Other E-Commerce Backend Issues: Emails will be sent to users in the correct language, but you may need to translate them if you don’t use WooCommerce’s default texts.
- Configure additional synchronization options: Choose additional product properties to keep in sync across languages, such product’s featured images and image galleries.
- Get help: We’re always glad to help in our technical forum, available in several languages, but please follow the guidelines provided in this section first so that we can help you more effectively.
Translating Store Pages
WooCommerce can automatically create the store pages for you, but you’ll need to translate them. This means creating translated pages for each of the store pages, and translating their content if needed.
With WPML, you obtain translated content for posts, products or pages through either the ‘translate’ icons (‘+’) or the duplicate buttons. Depending on how much content is shared you may prefer to use one or the other. If you duplicate, WPML will keep the contents synchronized. Any edits of a duplicate will be lost, but you can first duplicate and then later tell WPML to translate it independently, so you can change its content. You can reach the same destination by clicking ‘translate’ and then clicking the available buttons to ‘copy content from English’. Since the main content of WooCommerce store pages, at least initially, is the shortcodes that define their functionality (e.g [woocommerce_cart]), we describe here the process of batch duplication.
Step 1: Batch duplication
Go to WPML→Translation Management. This opens the Translation Dashboard. In “Filters”, select Page as the Type, and click Display. Select the WooCommerce pages (Shop, Cart, etc.) by clicking their checkbox, or click the chebox to the left of the “title” header/footer to select all displayed pages. Then, in Translation Options, choose the language(s) for which you want to create the pages, and check “duplicate content” on each, then click “Send documents”.
This will create a duplicate of every selected page for the chosen languages; these are actually new pages that are marked as translations of the original store pages (and that will be displayed in place of the original ones depending on the currently chosen language). As a result of duplicating the store pages for a language, you can already see in the front end that you have the store menus and pages set up for that language. You just need now to edit these “translations” to make them real translations. (Think of duplication as an “incomplete/needs update” initial translation.)
For more information about using content-duplication to batch-process pages, products, and posts, take a look at Displaying Untranslated Content using Content Duplication. Note that, as an alternative, you can also submit batches of documents for translation, using WPML Tranlation Management. This is done by selecting ‘Translate by’ instead of ‘Duplicate Content’ in the above screenshot.
Step 2: Individually edit each translated store page
With WooCommerce, this can be as simple as translating the title in each of the just created duplicates for each language.
Go to Pages:
If you see a + icon next to these pages, click on it. This will add the translation when it doesn’t exist already. In this case, you’ll see pencil icons to edit the translations of all store pages, since they have been created initially as duplicates. Since the content has been copied from the original, basically all you need to do is to change the title, as WooCommerce pages initially consist of a single shortcode. If you have changed the pages before translation, then you’ll also need to edit the content. But first, you need to ask WPML to let you ‘translate independently’ from the right sidebar top. After that, you’ll see a dropdown box labeled ‘This is a translation of”. E.g, if you are translating the cart page, the default language cart page should appear as selected.
You can verify that the contents have been copied correctly. For example, this is what we see in the Cart page:
This shortcode tells WordPress to display the cart. You need to have it in all translations. The translated pages have a button that let you copy from the original language. Use it to copy the original page content if it’s missing for any reason.
When you’re done, go to WooCommerce settings page and then select the pages tab. There you should have the same settings for the main language as in this screenshot:
There is an optional page setting for ‘Terms & Conditions’. Because this page is optional, it isn’t created by default during WooCommerce configuration. If you want such a page, create it with its translations and assign it in this screen as you did with other WooCommerce pages.
Similarly to the e-commerce pages that you’ve translated, you should also translate the products themselves.
The Products list is a custom admin page and doesn’t include WPML’s translation controls (the + and pencil icons).
You can translate products either when editing them or using WPML’s Translation Management module.
This is how the product-edit page looks like:
As before, you can translate by clicking on the + icon or duplicating and then unsynching the translation from the original.
WCML will automatically synchronize the non-text attributes of products. This includes the price (though this depends on multi-currency settings), weight dimensions and other features that don’t require translation. You can translate the names and description. If you want, you can enter the same names in different languages. These are the fields synchronized for simple (non-variable) products:
You can optionally add more fields to be synchronized, such as the product featured image or product image gallery, using WPML->Multilingual Content Setup, see Configuring additional synchronization options.
Batch translation of products:
As with store pages, you can massively duplicate products from WPML->Translation Management. In its Translation Dashboard tab select “Product” in “Filters”, press “Display”. Select the products to translate (or select them all by clicking the checbox left to the Title header and footer); choose the languages for which to generate duplicates; and “submit documents”. This will make all the newly created products to appear (still with duplicate content) in the shop page for the selected languages. Again, you will then need to edit each translation individually.
Translating Product Categories
Go to Product->Product Categories
At the bottom of the page you can set the language of category and switch languages at the top of the page. If you edit any of the categories, you will see something like this, with the links that allow to add translations of the category to any of the site’s languages:
Notice that you can also add translations from the bottom of the page. Adding a translation of a product category looks identical to adding a new product category (don’t forget to add a translated slug too), except that at the bottom you can see that the new category is a translation of the old one:
WooCommerce allows you to reorder the product categories by drag&drop. This order is kept synchronized across languages.
You can also add categories in other languages, then set what they are a translation of using the dropdown at the bottom of the above image. This dropdown will allow you to choose among the default language terms which are as yet untranslated to the language of the category you are editing.
Translating Attributes and Product Variations
WooCommerce comes with two types of attributes, which in WooCommerce may be taxonomies (“global product attributes”, defined from Product->Attributes) or simple strings (“custom product attributes”, added and defined in the edit product pages). They can be displayed in the front-end store’s product page, or used to define product variations. If you plan to reuse an attribute (say, Size, Colour) for multiple products, you should use taxonomies, so that they are available in the edit product page, as a dropdown:
Global product attributes
To enable the synchronization of product attributes across translations you need to first define the attributes at Products -> Attributes.
Next go to Products -> Attributes -> Configure Terms to add the different attribute values and translate them. At the bottom of the page you’ll see the available languages.
The procedure for translating global product attributes and their possible values is very similar to that for product categories (as said, a global product attribute is a WordPress taxonomy, just as product category is):
After translating the possible values (terms) of a global product attribute (taxonomy) they become available (with their translated values) in the edit-product page:
(That little Values box is searchable, by the way, and searches across the translated values. However, you should change the values only in the default language version of the product.)
Finally, note that you also want to translate the attribute’s name (‘Size’), so that the translated terms appear in the front end (though not in the backend, in the store admin). This is done from WPML->String Translation, where the string name is Size_attribute (see below).
Custom product attributes
Custom product attributes are mainly intended for a one-off use, for a single product. Once defined, they do not, for example, appear in the dropdown to select attributes in other products’ paged. If you do try to reuse them, you have to manually reenter their possible values in each product.
Here is an example of adding a custom product attribute. The ‘value’ is a pipe (‘|’) separated list of values, which can also be used to define product variations.
The attribute name and values will always appear in the edit product page in the default language, but as soon as you define them and save the product, they will be registered as strings in string translation. The attribute name, in the example ‘Model’ is registered as ‘Model_attribute’, and each of the possible values as ‘<value>_attribute_name’, e.g. ‘Model X25′ as ‘Model X25_attribute_name’. (The image also shows the ‘Size_attribute’ string, the name of the global product attribute we used earlier. Here is the place to translate it.)
Once translated, they will appear in the front-end in the correct language, including the dropdowns used to select product options before purchase. The next section on translating general texts provides more details on how string translation works. All attributes will appear in context ‘woocommerce’ in string translation.
These attributes, both global and custom, can be used to create the variations of a variable product, to which you can assign different prices, stock levels, etc.
These variations will also be synchronized from the original product to the translations. So you don’t need to do anything to translate product variations. Once you define the variations for a product using some attributes, when you translate or duplicate the product, those variations will carry through to the translated product. (For the case of translation, you need to save the post before the variations are copied.)
(Again, attempting to change the variations, or some of their properties, such as prices, from the edit product page of a translated product is futile; it’s the default language product variations that are synchronized.)
Translating General Texts
Your e-commerce site includes many small texts that are not part of any page or product. These come from the theme and from WooCommerce.
Both the theme and WooCommerce should come with their .po (i.e. localization) files. When you add a language, say Finish, through WPML->Languages, all the WooCommerce store texts will be immediately available and displayed in the Finish language store.
You can complete any missing translations using WPML’s String Translation module. To register the strings for translation, first follow the WPML instructions for theme and plugins localization.
Then, go to WPML->String Translation to actually translate the texts. (In this same module, you can actually import/export .po files.)
All WooCommerce strings are under context ‘plugin woocommerce’. You can use the Search tool to quickly find the texts that you need to translate.
For example, this is the ‘order tracking’ page:
It includes several strings that need translation (highlighted).
Go to WPML->String Translation, set the context to ‘plugin woocommerce‘ and search for each of these strings:
Translating the payment gateways and shipping methods texts:
You can translate the payment gateway titles and descriptions as well as the shipping method title. You will find these strings in the String Translation module under the ‘woocommerce’ context.
Click on the ‘translations’ link to open and edit them. Translate, click on the ‘translation is complete‘ box and save.
Translating the tax labels:
When you setup a tax zone in WooCommerce -> Settings -> Tax, you have to assign a label to it (e.g. VAT). This label can be translated in the String Translation module under the ‘woocommerce’ context. You might have to view the checkout page at least once so that these strings are registered for translation.
Other tax related strings are also registered for you to translate in this context.
WooCommerce 2.0.x handles taxes quite differently. Tax labels can now be directly translated from WooCommerce->Settings->Tax by editing the Tax Name field, see:
In effect, WooCommerce takes care of translating tax labels.
Product slug translation
CPT slug translation is a brand new and complex feature in WPML. It should be considered as experimental.
We added the feature to translate custom post types slugs to WPML and we make use of it here for products. This will allow you to have different a different product slug for each translation, like this:
Warning: If you are using WC 2.0.x, this only works with the default permalink structure for products (WordPress Settings->Permalinks), since WooCommerce hardcodes the English strings for other permalink structures.
These are the steps you need to follow to enable product slug translation (from WPML->Translation Management->Multilingual Content Setup):
|1. Enable global slug translation||2. Make the post type translatable and enter the slug|
The box in the second image is at the very bottom of the Multilingual Content Setup page, below “custom fields translation”.
Unfortunately this feature isn’t available for taxonomies yet, only for custom post types such as ‘product’.
You can optionally enable multiple currencies by going to WPML -> WooCommerce Multilingual. Here you can enable multiple currencies and assign a different currency to each language you have enabled in your site. You have the option to do automatic conversion by using a conversion ratio, or you can set the prices for each language/currency manually.
These are the implications of each option:
- If you don’t enable multi-currency, you are all set. Prices will be copied directly to the translated products, and, for any product and any language, the price of the original product in your currency will be used.
- If you enable multi-currency and the “automatic” option, prices in every store will be retrieved from the price of the original product, and computed on the fly from the currently saved exchange rates when displayed to the user in another language. This is much more flexible than it may seem, because you may change the exchange rate at any time (say, weekly). If you update either prices for the original product, or exchange rate for a given language/currency, this will be immediately reflected in the front end for all prices in any language.
- If you enable multi-currency and the “manual” option, you have all the flexibility you want, but then you have to “translate” prices (amount in the local currency for each locale) manually for each product and language.
Technically, both no-multicurrency and automatic multicurrency take the prices from the original (i.e. default language) version of the product. The former just displays those prices in the original currency, the latter automatically converts them using the currency and exchange rate settings for each language. On the other hand, manual multicurrency makes the price-related fields “translatable” – i.e WCML no longer copies them or keeps them in sync with the original product.
Multiple currencies for ‘one’ language
The store pages, prices and currencies displayed to the user depend on which language is selected. This might be a problem if you want, for example, to have prices in US dollars and British pounds. But there is a nice work around: you can add languages associated to different locales, e.g. en_GB and en_US. In order to do this, go to WPML->Languages, and click on Add/Remove Languages and then on Edit Languages. The image shows an additional row we added to have a second version of English:
You can then adjust the multicurrency settings to use the various currencies, for example:
If in addition you want to autodetect the language (and thus prices and currency) to show the user, see How to detect IP location and automatically display local language.
Inventory, Emails and Other E-Commerce Backend Issues
You might have noticed that WPML creates new products per language. Regardless of which language visitors used to order products, the shop admin will always see the items in the default language being ordered. This allows to manage inventory and track shipments correctly.
Visitors will receive all notification emails in their right language. For this to happen, the site admin must provide the translations. WooCommerce localization files provide translations for the standard WooCommerce mails, but if you want to change them, like other texts, emails can be translated via the String Translation screen.
Configuring additional synchronization options
WooCommerce Multilingual pre-sets a number custom fields and taxonomies for products to be synchronized, but WPML adds additional options. These options can be set from WPML->Translation Management -> Multilingual Content Setup. For your convenience, many of these options can also be seen and set from the edit-product page. The main options relevant to your ecommerce store are translation of custom fields and translation of custom taxonomies.
The image shows the only the top part of the list of custom fields, as it is quite long. The fields which are disabled are pre-set by WooCommerce Multilingual, using its wpml-config.xml file. You can see also that the product attributes you define are set to “Translate” when created. And you can set other options. For example, by setting _thumbnail_id (for the product’s featured image) and _product_image_gallery to “Copy from original” you can have your images synchronized across languages (you will see these fields here only after you have added images to at least one product). If your images or other media files also include textual elements (captions, etc.) consider using the WPML Media plugin.
You can also choose settings for custom taxonomies and translate some additional WooCommerce admin texts from here:
If you need help with WooCommerce Multilingual, please head over to our technical forum.
Before posting about issues, we recommend that you review this quick checklist:
- You actually installed and activated WooCommerce Multilingual and it’s updated.
- The WooCommerce store pages exist in your site and are translated. Even if your theme doesn’t need them, make sure that they exist in the DB.
- WPML’s String Translation module is activated. Many of the strings that you’ll want to translate are there.
When you report issues, please:
- Tell us which version you’re using for WordPress, WooCommerce, WooCommerce Multilingual.
- Tell us about your site’s languages and the default language.
- Tell us which URL structure you’re using.
- List any other major plugins that you’re using, especially those that may be involved with changing URL structure. You can choose WooCommerce->System Status to send us that information.
- Tag your thread with the keyword WooCommerce. This will help route it to the correct support person.