
Delivering a personalised user experience when you sell worldwide means a lot of things — displaying customer-specific banners, translating products, categories and more. However, one of the first steps includes enabling language and currency switchers. Let's focus on the latter.
Magento by default allows you to add multiple currencies and display them in the header. However, it's not always enough. People still need to switch between them manually.
So, today you'll learn how to take that to the next level. You'll discover how to switch currencies for visitors automatically using the
.Configure Auto Currency Switcher
Once you install the extension navigate to Stores > Configuration > Magefan Extensions > Auto Currency Switcher and enable the extension to start the configuration.
1. Complete general settings
In the general setting, you just choose whether to Round Prices and Base Currency Prices. Then choose the Rounding Algorithm.
Here are some examples of the round algorithms:
- Round (14.3 -> 14.00, 14.5 -> 15.00)
- Ceil (14.3 -> 15.00, 14.5 -> 15.00)
- Round 10 (12.3 -> 10.00, 17.5 -> 20.00)
- Ceil 10 (12.3 -> 15.00, 17.5 -> 20.00)
- Round .99 (14.3 -> 13.99, 14.5 -> 14.99)
- Ceil .99 (14.3 -> 14.99, 14.5 -> 14.99)
- Round .95 (14.3 -> 13.95, 14.5 -> 14.95)
- Ceil .95 (14.3 -> 14.95, 14.5 -> 14.95)
- Floor (2.31 - > 2, 2.55 -> 3)
Note: if you add tax to the prices in the admin panel, the rounding won't work.
2. Set user restrictions
You don't need to switch currencies automatically for everyone. Specifically for the User Agents (bots). Just specify them in the corresponding field and they won't be redirected when scanning your website.
e.g. auto-switching will be displayed for Google bot, it will crawl your website as usual.
3. Set default currency by country
Here you basically specify which currency to display by default in a particular country. Just select a region and country you are interested in and choose any currency from the list.
Note: currencies you see in this section must be selected in the Allowed Currencies (Stores > Configuration > General > Currency Setup).
To see how it works in real-time check out this short video:
4. Configure GeoIP databases (if necessary)
The Auto Magento 2 Currency Switcher comes with the GeoIP Database out of the box. However, to ensure customers' location is detected properly we offer two more options — MaxMind and Cloudflare.
If you use any of these you can configure them in the corresponding tabs. Just specify the Lisence Key for MaxMind and enable Cloudflare IP Geolocation if you use Cloudflare.
Don't forget to Save the settings once you finish.
5. Test auto currency switcher
The final step in the Auto Currency Switcher setup is testing. You need to make sure currencies are displayed according to the "Default Currency by Country" settings.
Note: make sure that all website caches are enabled before you do the testing.
To start, navigate to the GeoIP Database tab and find the Developer (Simulate Geolocation) section. Enter your IPs in the Allowed IPs field and separate them by a comma. Then set the Simulate Country for the allowed IPs.
e.g. you set that visitors from your IP (though its US) should be recognized as visitors from India.
Save the settings and clean the browser cookies or better open your website URL in the incognito tab. You should land on a page with the currency you've set for the simulated country (in our case — India).
Don't forget to clear the Developer (Simulate Geolocation) fields after testing and clean Magento cache.
From now on visitors won't need to switch currency to see prices in their local currency. You do that for them automatically. It helps you to deliver better user experience and increase conversions.
However, that's not the only thing you need to take care of. Configure the Auto Language Switcher and redirect people to the store view in their local language to double the benefits.