WPML Integration and Multi-Currency Support

Version 2.8 of WooCommerce Wholesale Ordering adds full support for WPML/WCML, including multi-currency support and optimizations.  If you are not using the Multi-Currency feature, there is nothing extra you need to configure in the settings. However, even if you don’t use Multi-Currency, you should still read over the below sections to ensure that the wholesale prices get properly configured for every translation of your products, and that custom text and message fields are properly translated for each language.

Requirements

Full multi-currency support, including manual currency prices, is only possible with the new filter hooks added in WCML version 3.8, so you need to be running at least that version to use Multi-Currency with wholesale prices.  Version 2.8 of Wholesale Ordering was created and tested using versions 3.4.1 of WPML Multilingual CMS, 3.8.2 of WooCommerce Multilingual, 2.3.9 of WPML String Translation, 2.2.1 of WPML Translation Management, and 2.1.22 of WPML Media.

Settings

When WPML/WCML is active on your site, there will be a new section “WPML Integration” within the Wholesale tab of the WooCommerce>Settings page.

If you have Multi-Currency enabled, there will be a check box “Save min/max currency prices”. This is enabled by default and will save the min & max variation wholesale prices for each active currency in the post meta table for the Variable parent product. If you have a lot of Variable products displayed in your shop, this may help speed up the page load time as the displayed price range will be shown by getting those saved min/max values from the database, as opposed to looping through every child variation of the Variable product, calculating the wholesale price for each, and determining the min and max. If you disable this feature, wholesale price ranges for Variable products will always be calculated by looping through all variations and calculating the price for each.

After Multi-Currency has been enabled and you have added the additional currencies you want to use, you should run the Sync Variable Products function again so that default values can be set for every currency. This should be done whether or not you are using saved min/max currency prices. After that, Variable products will automatically sync (individually) any time that you edit them.

Currency Minimum Wholesale Order Amounts

This settings section allows you to manually set different minimum wholesale order amounts for each currency.  To use this feature, you first have to have a minimum order amount set in the General section of the Wholesale tab of the WooCommerce>Settings page.  The minimum order amount you set in the General section will be used for your default currency.  Once you have an amount set there, then you can manually set the minimum order amount for other currencies in the WPML Integration section. If you leave the values for each currency blank there, then those values will be automatically calculated based on the currency exchange rates you have set in the WCML plugin.  But, if the exchange rates make those an odd value, you can manually set them in this section to whatever you want.

Product Translations

You shouldn’t have to change anything for Wholesale Ordering to work with product translations.  The wholesale product meta fields (wholesale price, wholesale only, wholesale tax status, and wholesale tax class), are set to be copied to translations.

However, you need to make sure to create and translate the products the correct way for this to work. I strongly suggest that you use the WPML recommended way of using their own “WPML Translation Editor” to translate products, instead of using the “Native WooCommerce product editing screen” to edit your translations.  In short, you should always duplicate your products after you create the original product in the main site language and edit the text translations using the product WPML Translation editor.  Alternately, you can go directly to the Translation Editor and create translations of existing products there.  Using one of those two ways, the prices and all other product fields set to “copy” will always be copied to all translations, and you won’t have to worry about prices getting out of sync between translations. If you ever need to change prices, you use the regular WooCommerce product editor, while your admin area is set to the site default language, and then just change the prices on only that version of the product. When you hit update, those prices will be copied to any other language versions.

To summarize, if you are creating a new product, make sure you are creating it in the default language of your site. After you enter all the info and publish the product, you have two ways to create the translations. Right after the product is published, you will see some new options in the Language meta box above the Publish box.  You can either check the boxes for the “Duplicate” option, which will simply duplicate the product with the default language text to each translated language (you can edit the text for the other translations later), or you can click on the + signs to create the translation and open the Translation Editor for that product to edit the text right then. The third option is to do nothing, which will then leave that product in only the default language, and you can come back to it later to create the translations.

Unless you have a very strong reason to, it is NOT recommended to use the Native WooCommerce product editing screen and then to create an independent product copy for each language (you can do that if you are editing the product in a non-default language and you set the “This is a translation of” select box to “none”).  If you do that and save the product, then that particular language product becomes its own separate product, with its own independent price fields (the fields will become unlocked after you publish it). At that point, you will need to remember that your different language versions of that product are no longer synchronized, so if you change the prices of one language, you need to remember to change the prices for the other language versions as well.

Multi-Currency Prices

If you are using at least version 3.8 of the WooCommerce Multilingual plugin, then wholesale prices will work fully with Multi-Currency, with either automatic conversions, or manual setting of prices for each currency.

Automatic Conversions

If you already have wholesale prices entered for your products in the default language, and you enable multi-currency mode and add some additional currencies, then by default, all prices, including wholesale prices, will be automatically converted to the other currencies based on the currency exchange rates you set when you set up the additional currencies.  There is nothing additional you need to do for this to work. However, if you have Variable products, you should run the Sync Variable Products function again so that the mix/max variation prices can be calculated for each variable product for the shop price range display (they will be calculated with the exchange rates you set). Alternately, you can disable the saving of min/max variation prices for each currency (as described above), and those price ranges will be re-calculated on every page load.

Manual Conversions

If you don’t want to use automatic currency conversion, you can manually enter prices for each product or variation in each currency. WCML adds a couple of radio buttons on the product/variation editor pages where you can set if prices are calculated automatically, or entered manually.  This is set on a per product, or per variation, level, so you can create manual prices for just some products or variations, but still use automatic conversion for others. If you set it to manual, you will then be presented with a set of price fields for each additional currency, including wholesale price fields.  For each currency, you can manually enter a wholesale price, or leave it blank. If you leave it blank for one or more currencies, then the wholesale price for each blank currency will be automatically calculated based on the exchange rate you entered and the wholesale price in the default currency.  Thus, “manual” currency prices only apply if you actually enter a wholesale price for that specific currency, otherwise it will still be calculated automatically. In other words, it’s not possible to not have a wholesale price for only some currencies… it’s all or nothing.

The only exception/quirk to the manual prices is that if you leave the wholesale price blank for the default currency, you can still manually enter wholesale prices for one or more other currencies, in which case you will only see wholesale prices (and only be able to add-to-cart) when viewing in one of the currencies where you did enter a price. However, if you have the Wholesale Ordering plugin set to hide products without a wholesale price (from Wholesale Customers), then that product will never show up in the shop loop no matter what currency you are currently set to, since the query that filter products without prices is done on the main (default currency) wholesale price meta field.  I’m not sure why you would ever want to set up any products that way, but it is possible.

Translation of custom Messages and Text

Wholesale Ordering has quite a few custom messages and text strings that can be defined by admin in the settings page. There are several in the “General” section, and quite a few more in the “Messages and Text” section.  These will need translation for other languages.  All of these custom strings are registered through the plugin so that they can be translated easily from the “String Translation” page of WPML.  Note that if you leave some of those fields blank in the Wholesale Ordering settings, those fields will NOT show up on the String Translation.

The easiest way to find and translate those custom strings from the WPML String Translation page is to select “WooCommerce Wholesale Ordering” from the “Select strings within domain:” select box and hit the search button. You can then edit each string translation. Keep in mind that there are placeholders in some of those strings that will be replaced by values calculated by the plugin when displayed.  For how to use those placeholders, see the description on the settings pages for Wholesale Ordering.