Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

Switching the currency based on the client's location doesn't work on Nginx Reverse Proxy

Solution:

WooCommerce Multilingual & Multicurrency plugin uses the built-in API in WooCommerce for geolocation: https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-geolocation.html#source-view.80.

So what is happening on your website is the server's IP is being served instead of the actual user IP. That means the website will see every user visiting the website is located in the US.

We came across a helpful document at https://ypereirareis.github.io/blog/2017/02/15/nginx-real-ip-behind-nginx-reverse-proxy/ that provides instructions on obtaining the actual user IP. Kindly review the document and let us know how it goes.

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 2 voices.

Last updated by Ahmed Mohammed 1 year, 8 months ago.

Assisted by: Ahmed Mohammed.

Author Posts
May 3, 2023 at 5:09 am

saudA-6

The automatic currency switching by country doesn't work on Nginx Reverse Proxy

May 3, 2023 at 5:35 am
May 3, 2023 at 9:20 pm #13582123

saudA-6

Good day, just wondering if anyone is handling this issue. It's been less than 24 hours and my website still looks like this (The screenshot is attached). Thank you

May 4, 2023 at 8:50 pm #13590121

saudA-6

I can't seem to get attention to my problem. Left my website with all plugins disabled for 24 hours. We agree that your side will do everything to see where the problem is, but hopefully not for this long. Thank you

May 5, 2023 at 7:38 am #13591333

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Saud,

My apologies for the delayed response, it was not intentional. I'm currently investigating the issue and we will provide you with an update as soon as possible.

May 5, 2023 at 8:50 am #13592065

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Saud,

I've forwarded your ticket to our second-tier support team, who will investigate the issue. I'll keep you informed of any updates. In the meantime, you're welcome to reactivate the website's plugins.

May 5, 2023 at 4:19 pm #13595667

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

I appreciate your patience while we were looking into this.

WooCommerce Multilingual & Multicurrency plugin uses the built-in API in WooCommerce for geolocation: hidden link.

So what is happening on your website is the server's IP is being served instead of the actual user IP. That means the website will see every user visiting the website is located in the US.

We came across a helpful document at hidden link that provides instructions on obtaining the actual user IP. Kindly review the document and let us know how it goes.

Looking forward to hearing back from you.

May 5, 2023 at 9:05 pm #13596993

saudA-6

Thank you very much for the advice and I will study properly using the documentation from the link you forwarded.

May 8, 2023 at 9:18 am #13603373

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Saud,

Super glad to hear that we were able to help!

I'll mark this thread as resolved. If you require any further assistance, please feel free to open a new thread.

Regards,