This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 3 voices.

Last updated by davidV-73 1 year, 8 months ago.

Assigned support staff: Yuri.

Author Posts
January 24, 2018 at 8:52 pm #1496036

Frederik Bjerrum

Don't you support auto detect currency. Our store is setup with EUR as default but if a US customer visit our store she need to choose currency manual... Is that right?

Frederik

January 24, 2018 at 9:56 pm #1496079

Yuri

Hi, you can use both "Automatic Language Redirect" and "Default Currency" functionalities to make this work.

For the "Browser language redirect" part you need to go to WPML > Languages > Browser Language Redirect and set the option to always redirect. This option will redirect a user based on his browser language configuration.

For the Default Currency you need to go to WooCommerce > Woocommerce Multilingual > Multi-Currency. On this page, you will configure the currencies you want to support and at the bottom of the currency list you can set what language will use what currency as a "Default" one. I've attached an image showing this configuration.

When a user from France with a browser configured with the French language access your site he will be redirected to the French version of your site. Configuring the French version of your site as using Euros as default will make it automatically selected for the user.

Let me know if this is what you were looking for.

January 24, 2018 at 10:17 pm #1496102

Frederik Bjerrum

Thank Yurl,

I understand - but my problem is that we use 2 languages danish = DKK and English = GBP, USD, CAD, AUD etc. So when a visitor comes from uk she should see the prices in GBP and a visitor from US in USD etc...

Later on we want to have the store in Spanish (USD and EUR) so the Spanish speaking people in the US the the prices in USD and the people from Spain see the prices in EUR.

The same goes for the language French (people from Canada and France)

How do I manage that...?

January 25, 2018 at 8:14 am #1496405

Frederik Bjerrum

Hi Yurl, Did you see my post?

Frederik

January 25, 2018 at 10:34 am #1496643

Yuri

Hi, unfortunately, the setup you need will is possible but with a bit more work than usual. Since you will need English to be compromised of 4 currencies you will not be able to use only the default languages within WPML. You need a specific language for each of them and creating 4 languages along with records for each of them when you are in fact working with only one (English) will create a bit of overhead maintaining the records.

For example, you will need to have the same product with 4 different translations, each assigned to a custom language (take notice that these are not the default languages already included with WPML).

- Product 1
- US (hidden link) using USD
- UK (hidden link) using GBP
- AU (hidden link) using AUD
- CA (hidden link) using CAD

Each product beyond the original for the US will be another record but translated. For each new currency, you want to add you will need to add the necessary language as well. So when you add Spanish for the US you will need to add the language "es-us" and assign it to USD and then create yet another language as "es-eu" and assign it to EUR.

You also need to take notice that the Browser Language Redirect is based on the language configured by the user on his browser and not his geoLocation. So a user in the US with a browser in French would not see the English page/currency, but the French page/currency.

An alternative would be to use a geoLocation plugin to redirect the user to a language according to his location but you will still have to deal with the multiple languages necessary to granularly assign each currency.

It will give you a bit of overhead while maintaining the site but it is doable with the additional getLocation plugin. As a starting point here is the geoLocation plugin list in the WordPress repository. https://wordpress.org/plugins/tags/geolocation/

I believe that the first one may be ideal since they use the MaxMind free database and you can test and play around with it to see if it suits your expectations.

January 25, 2018 at 12:16 pm #1496812

Frederik Bjerrum

Thank Yurl, but it seems to be very complicated just to show the relevant currency.

What about a script - could that work..?

I'm not technical 🙁

Frederik

January 26, 2018 at 7:22 pm #1498670

Yuri

Hi, currently WPML does not have an out-of-the-box solution for this. You would need to implement this yourself using a geoLocation plugin/script combined with one of our API hooks (https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/#hook-1113509).

Since this level of work is outside the scope of our support forum I would recommend you enlist the help of a developer to custom code this solution for you. As a starting point you can check our list of Contractors here: https://wpml.org/contractors/

September 16, 2019 at 2:37 pm #4581557

davidV-73

@yuri How about when a US customer connects to the site gets to automatically pay in USD, and when a Canadian customer connects to the site gets to automatically pay in CAD using GeoIP. Both using the English language. How does this work?