Skip Navigation
Updated
January 10, 2022

WooCommerce Multilingual includes support for running a multilingual e-commerce site with multiple currencies, independent of the site’s languages. You can set pricing using a configurable exchange rates map or per product. On the front-end, users are able to switch between the different available currencies, like they switch languages.

Please note: Caching plugins may cause issues with WCML multi-currency settings.

Configuring Currencies

There are two ways you can configure currencies: based on language or based on your customer’s location.

Currencies Per Language

Configuring currencies per language allows specific currencies to show for specific languages. This helps with situations when products in certain languages need to be ordered only in a specific currency.

You can also configure which currencies are shown by default for each language. This way, users see product prices in a given currency when they switch to a different language on the front-end.

You can configure currencies per language by going to WooCommerce → WooCommerce Multilingual, and clicking the Multi-currency tab.

Multi-currency Settings
Multi-currency Settings

Choosing Keep for the default currency option under a particular language means the currency will remain the same when switching to that language.

When a new currency is added it is included by default for all languages. You can adjust this using the appropriate checkboxes.

Currencies Per Location

If you have customers in countries that speak the same language but use different currencies, you may want to configure your currencies based on your customers’ IP address or billing address (if they’re logged in).

This is useful if you would like to:

  • Enforce certain currencies for users based on their location or billing address.
  • Implement a pricing policy based on location.

For example, you can decide to set a higher price for someone in the US (paying in USD) rather than for clients in the UK (paying in GBP). You can set it so that customers won’t see the prices in the other country’s currency, even though both customers speak English.

To set up currencies per location, go to WooCommerce → Settings, and click the Multi-currency tab.

WooCommerce uses MaxMind Geolocation to determine a customer’s location via IP address. You’ll need to create a MaxMind account and generate a new license key in order to determine a customer’s location.

Choosing to show currencies based on client location
Choosing to show currencies based on client location

Once you enter the key in the Multi-currency settings, you’re ready to customize your currencies per country.

Setting up currencies per country
Setting up currencies per country

Click the edit icon next to each currency to customize the countries for which you would like it to appear.

Adjusting currency settings
Adjusting currency settings

Once you enable the Multi-currency mode to show currencies based on client location, customers who log in will see currencies based on their billing address.

Currencies by Geolocation

You can alternatively choose to enforce currencies based on the exact geolocation of your users by going to WooCommerce → Settings. In the General tab, set the Default Customer Location to Geolocate. WooCommerce will now display price and currency based on the IP-location of your customer.

wpml-woocommerce-general-settings-geolocation
Setting default customer location to Geolocate

If you’ve additionally chosen to limit selling locations to specific countries, WooCommerce will show customers from these countries your previously assigned currencies. All other customers will see your store’s fallback currency.

Geolocation may affect Multi-currency. This is because:

  • The MaxMind database determines customer geolocation. Customers will see your store’s default currency if their IP address does not match one in MaxMind’s database.
  • Transients and WooCommerce sessions save IP addresses in order to show specific content to customers in certain locations. As a result, prices may appear in the same currency for VPN users in various countries.

To allow overriding of the WCML geolocated country, you can use the wcml_geolocation_get_user_country filter.

Payment Gateways Settings

By clicking on the Edit icon for a currency in the Multi-currency tab, you can access the set of options related to currency display, exchange rate, and Payment Gateways options.

Currently, supported payment gateways are Paypal, Stripe, and BACS/wire transfer as enabled in WooCommerce’s default payment options. For compatibility information on using a payment gateway plugin, please check our list of Recommended Plugins.

Since not all payment gateways accept all currencies you can define ways to automatically make a conversion before making the transaction in a supported currency.

Currency settings

On the checkout page, a notice shows which currency will be used in the transaction if it is different than the one already selected by the user. The total amount is also displayed in the converted currency.

Payment notice on a checkout page
Payment notice on a checkout page

Choosing Which Payment Gateways to Display Based on Customer Location

Some payment gateways are only available in specific countries. If you have geolocation set up to display currencies per customer location, you can determine which payment gateways to display based on customer location.

To adjust which countries a certain payment gateway appears in, go to WooCommerce → Settings and click the Payments tab. Click the payment method you would like to adjust, and you will see the option to change the Country Availability.

Choosing for which countries your payment gateway will show
Choosing for which countries your payment gateway will show

Setting an Automatic Exchange Rate

WooCommerce Multilingual allows you to set up automatic exchange rates for your store. There are three options to set for this feature.

  1. Use the Exchange rates source to select the source of the exchange rates data. You can choose from four renowned services: Fixer.io, currencylayer, Exchange Rates API, and Open Exchange Rates.
  2. You can set an additional Lifting charge percentage to adjust the final, effective exchange rate. This is useful for international transactions that may add additional charges.

    The following is how the effective rate is calculated, based on the set lifting charge:

    Effective Rate = Service Rate x (1 + Lifting Charge / 100)

  3. Set how frequently the automatic exchange rates are updated for your store. This can be hourly, daily, weekly, or monthly. By default, this is set to manual update. Please note: Updating the exchange rates on an hourly basis generates around 744 API calls a month. Please check that your exchange rates source can accommodate this higher usage.
Automatic exchange rate options
Settings for the automatic exchange rates

Configure Distinct Prices for Different Currencies

Configuring Product Prices

WooCommerce Multilingual also includes the option to set custom prices in different currencies.

Setting custom prices in different currencies can be enabled from the post editor, under the fields for Regular Price and Sale Price (for the default currency).

These are fixed and will override prices that are automatically determined by the exchange rate. To revert to using the automatic prices you need to remove the custom prices and update the product.

Setting Custom Prices

A similar interface exists on the variable products editing screen. You have the possibility of adding custom prices for variations or currencies.

Setting Shipping Rates

You can also configure distinct shipping rates per currency for the following standard WooCommerce shipping methods:

  • Flat rate – Set the main flat rate and rate for shipping class (if any are defined)
  • Free shipping – Set the minimum amount
  • Local pickup – Set the handling fee

In the following example, we customized rates for flat rate shipping by going to WooCommerce → Settings and click the Shipping tab. Click Edit under the shipping method you would like to customize, and a pop-up dialog will appear.

Editing a shipping method on the WooCommerce Settings page
Editing a shipping method on the WooCommerce Settings page

In the pop-up, use the Cost field to define the shipping cost in your default currency. From the Enable costs in custom currencies dropdown, select Calculate shipping costs in other currencies manually. Enter the custom prices for the rest of your currencies in the fields that appear.

Setting the custom flat-rate costs in secondary currencies
Setting the custom flat-rate costs in secondary currencies

Orders Currencies

Orders have a specific currency associated with them. It is the currency that the user was using when placing the order. This is also reflected on the back-end, where on the Orders page, each order shows the total in the corresponding currency. On this page, it is also possible to filter the orders by currency.

Orders Filtered By Currency

Since all created orders have a currency associated, WooCommerce Analytics are broken down by currency.

WooCommerce Analytics Filtered By Currency

Adding a Currency Switcher to the Front-End

Once you have added the support for multiple currencies, you should display a currency switcher in your site’s theme. You can display the currency switcher with a shortcode or as a hook.

Currency Switcher Shortcode

Shortcode: [currency_switcher]

Attributes: format (Available tags: %name%, %code%, %symbol%) Default: %name% (%symbol%)

Example usage: [currency_switcher format="%code% (%symbol%)"]

The shortcode version is the most convenient when you display the currency switcher inline with WordPress content, for example in Content Templates, by the Toolset Blocks plugin. You should use the Fields and Text block to include the shortcode into the template.

Currency Switcher as PHP Code

PHP code: do_action('wcml_currency_switcher', array('format' => '%name% (%symbol%)'));

The other available parameter besides “format”:

  • switcher_style: wcml-dropdown, wcml-dropdown-click, wcml-horizontal-list, wcml-vertical-list

Outputs a basic dropdown menu with currency codes for option values. The client’s current currency or the configured default currency for a specific language will be auto-selected.

Using Custom Switchers

Besides these default switcher_style options, you can also use your custom ones, defined by the custom currency switcher you design using template files. In this case, you need to use the correct slug that identifies your custom currency switcher.

The slug for your custom switcher is generated depending on the sanitized name of your template, as defined in its config.json file, and the template’s location:

Location of the custom currency switcherHow the slug is generated
Theme folderTheme slug + sanitized switcher name
Plugin folderPlugin slug + sanitized switcher name
“uploads” folder“uploads-” + sanitized switcher name

Let’s consider the following example:

  • The name of your custom currency switcher is “My custom switcher”.
  • You are using the Twenty Seventeen theme and the template files for your switchers are located in the theme’s folder.

The slug to use with your custom switcher is twenty-seventeen-my-custom-switcher, as shown in the following example.

Using custom currency switcher in PHP templates
do_action('wcml_currency_switcher', array(
  'format' => '%name% (%symbol%)',
  'switcher_style' => 'twenty-seventeen-my-custom-switcher'
));

The PHP code version is best when you manually add the currency switcher to PHP templates.

Sample of currencies switcher display on the frontend

Currency Switcher Widget

The currency switcher can also be added to a template as a standard WordPress widget.

Currency Switcher Options

Options for the currency switcher can be configured on the Multi-currency tab of WooCommerce Multilingual main settings page.

Currency switcher options allow you to:

  • Preview how the switcher will look on the front-end before applying changes.
  • Set the switcher style.
  • Arrange the order of currencies in the switcher using drag-and-drop.
  • Adjust the output of the switcher.
  • Show a currency selector on the product page template.
Currency Switcher Options

Adjusting the Output of the Switcher

You can customize the template used for the currency switcher by using the four parameters:

  • %name% – full name of the currency, for example “Euro”
  • %symbol% – the standard symbol that represents the currency, for example “$” or “€”.
  • %code% – the standard code that represents the currency, for example “USD”, for United States Dollar.
  • %subtotal% – total costs of the current order (basket), without shipping costs and additional taxes. Subtotal is the formatted price and includes the currency symbol positioned according to the currency options set in WooCommerce settings.

Starting with version 3.9, WooCommerce Multilingual allows you to use the following HTML tags to customize the output of the switcher: img, span, em, strong and u. Please note that these tags can only be used when the currency switcher style is set to List of currencies. This stems from the official HTML standards for the select tag.

Currencies Options and Rounding Rules

Currency Rounding Rules
Currency Rounding Rules

Besides the exchange rate, it is possible to configure things like the currency position, separator for thousands, decimal separator, and number of decimals for each separate currency. This is similar to how these can be defined for the default WooCommerce Currency in the standard WooCommerce screen.

When you set pricing per currency, you can have WooCommerce Multilingual to auto-convert the prices, while keeping them “elegant”. This is possible with the use of rounding rules that can be configured next to the general currency options.

The prices that are determined automatically can be rounded to the nearest integer.

Increment for nearest integer:

  • 1454.07 becomes 1454 when this value is 1
  • 1454.07 becomes 1450 when this value is 10
  • 1454.07 becomes 1500 when this value is 100

Autosubtract amount: the value to be subtracted from the amount obtained previously.

For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499.

Developer Information – Using Low-Level Hooks to Set Up Your Own Multi-Currency Logic

WooCommerce Multilingual defines a set of filters and hooks that can be used by 3rd party plugins to implement multi-currency logic when WooCommerce and WooCommmerce Multilingual are set up and running. With this, the users are able to see prices in their preferred currency (the price amounts are being determined based on the currencies exchange rates map). The orders are placed in the currency that the user selects on the front-end.