FOX - WooCommerce Currency Switcher Professional

Display a WooCommerce Currency Different From the Base Currency

A WooCommerce display currency different from the base currency is a common need: you enter prices in US dollars because that is what you pay your suppliers, but your customers should see Turkish lira, or a shop based in the eurozone should greet new visitors in dollars. FOX covers both cases. The Welcome currency decides what a new visitor sees first, and one short snippet locks the whole storefront to a single currency. This guide explains the difference between the base and the welcome currency, why the welcome currency sometimes seems to be ignored, and how to set up a storefront that shows only one non-base currency.

Base currency and welcome currency are different settings

The base currency is the one marked Basic in the Currencies tab of WooCommerce → Settings → Currency. When you save, FOX writes it into the WooCommerce store currency. Every amount you type is in this currency: product prices, coupon amounts, shipping costs, free shipping minimums. All other currencies are converted from it with their Rate.

The welcome currency, in the Options tab, is only the currency a new visitor starts in. It changes no price data, so you can change it at any time.

Changing the base currency is a different matter. FOX does not convert your product prices when you mark another currency as Basic: a product that cost 100 dollars costs 100 lira afterwards. So the first decision is which currency you want to type prices in:

Your situationSetup
You price in the currency you sell in, one currency onlyMake it the WooCommerce store currency and enter prices in it. No conversion is needed.
You price in one currency and want to show another, converted at the current rateKeep the pricing currency as Basic, add the display currency with its rate, and use the welcome currency or the lock below.
New visitors should start in another currency, but may switchWelcome currency only.

Show new visitors a currency different from the base currency

Select the currency in Welcome currency in the Options tab and save. A visitor who has no stored currency yet gets it on their first page view, and then keeps whatever they choose in the switcher. Pick a currency whose Visible switch is on in the Currencies tab; the option's description warns against a hidden one.

If you also use GeoIP rules, they take priority. FOX applies the welcome currency at the start of the first request and the GeoIP rules a moment later on the same page view, so a visitor whose country is in a GeoIP list gets that list's currency. The welcome currency is effectively the currency for everyone else; automatically change currency by country shows how the two work together.

Why the welcome currency "does not work"

Almost every report of an ignored welcome currency is one of these:

  • You are not a new visitor. The welcome currency applies once. After that FOX stores the visitor's currency and uses it on every page, and changing the welcome currency later does not touch visitors who already have one. Your own browser has a stored currency from your tests.
  • The storage identifies you by IP address. With Currency storage set to Transient, Memcached or Redis, every browser and device on your connection counts as the same visitor, so a private window or a second phone on the same Wi-Fi still shows the stored currency. Test from another connection, for example mobile data. With PHP Session or FOX Session, a fresh private window is enough.
  • A GeoIP rule covers your country, as described above.
  • The page comes from a page cache, built for a visitor who had another currency. Enable I am using cache plugin on my site in the Options tab and purge the cache; why a currency switcher and a page cache fight each other explains the rest.

To see what FOX uses for you, put [woocs_show_current_currency] on an uncached draft page.

Lock the storefront to one display currency

The welcome currency cannot stop visitors from switching, and visitors who once chose another currency keep it. To show every visitor one currency that is not the base currency, on every page:

  1. Keep the currency you price in as Basic and add the display currency in the Currencies tab, with an up-to-date rate or Rate auto update in the Options tab.
  2. Set Welcome currency to the display currency.
  3. Press Clear all for every currency in the GeoIP tab, so no rule picks another currency.
  4. Remove every switcher: the [woocs] shortcode, the widget, menu items, and the side switcher in the Side tab. You can also turn Visible off for the base currency so it never appears anywhere.
  5. Add the snippet below, with your currency code.
/*
 * FOX: every visitor sees and uses one currency, on every page.
 * Child theme functions.php or a code snippets plugin.
 */
add_action('wp_head', function () {
    global $WOOCS;
    if (!empty($WOOCS)) {
        $WOOCS->set_currency('TRY'); // the display currency code from the Currencies tab
    }
}, 1000);

$WOOCS->set_currency() makes the currency current and stores it for the visitor, so the AJAX requests that follow, such as the mini cart and the checkout updates, use it too. The code must be one of your currencies; for a code that is not in the list FOX falls back to the base currency. Priority 1000 runs it after FOX's own work in wp_head, where the GeoIP rules are applied, so even the very first page view is right. Many older snippets use the default priority and can lose that first page to a GeoIP rule.

The snippet runs when WordPress builds a page, not when a page cache serves stored HTML. That is why steps 2 and 3 matter: with the welcome currency set to the display currency and no GeoIP rules, a new visitor gets the display currency on every path through FOX, including the price redraw on cached pages. A returning visitor who chose another currency before you added the lock can still see it on cached pages, until they open a page that is never cached, such as the cart or the checkout. There the snippet runs, so the checkout always shows the locked currency.

Which currency the customer pays in

The lock decides what customers see. What they are charged in depends on Is multiple allowed in the Advanced tab. With Yes, the checkout, the order and the payment stay in the display currency, so your gateway must accept it. With No, FOX recalculates the order review and the order in the base currency, and the lock would surround a base-currency order review with display-currency prices; in that case start the function with if (is_checkout()) { return; } so the checkout shows the base currency throughout. Show prices in local currency, charge in base currency explains how to tell customers about it.

Amounts you type, rates and orders

  • Coupon amounts and minimum spends, shipping costs and free shipping minimums are entered in the base currency and converted at the current rate. Typing a lira amount into a dollar-based shop turns a 1,000 lira threshold into 1,000 dollars. To set exact amounts in the display currency, enable Individual fixed amount for coupon and Individual fixed amount for shipping in the Advanced tab (both need Is multiple allowed = Yes); the coupon screen and the Flat rate and Free shipping method settings then get a field per currency.
  • Product prices follow the rate. Every rate update moves the displayed prices. For round prices, see round converted prices; for exact prices in the display currency, Individual fixed prices rules for each product adds a price field per currency to each product.
  • Orders and e-mails show the currency the order was placed in. WooCommerce reports do not convert between currencies; see multi-currency analytics.

To show the base price next to the display price, for example for transparency with foreign customers, Show price info icon in the Options tab adds an icon next to the price that lists it in all your currencies on hover; how to display two currencies on product pages shows a code alternative.

Checklist

  • The pricing currency is Basic; product prices were not expected to convert when you changed it.
  • The welcome currency is the one new visitors should see, and it is visible.
  • GeoIP lists are empty, or you accept that listed countries get their own currency.
  • For a locked storefront: no switchers, the snippet with priority 1000, and the welcome currency equal to the locked currency.
  • Is multiple allowed matches the currency you can actually charge.
  • Tested as a new visitor, on an uncached page, from a connection that has not visited the shop.

If a new visitor still sees the wrong currency with caches disabled, open a topic on the FOX support forum with your Currencies, Options and GeoIP settings and the code you use, and we will look at it.