First things first, if you visit http://www.ip2nation.com you can double check that your IP is being correctly recognised as a UK one.
Be aware that if you are running any third party caching software that will cache only one version of the page, so any change of locale will not be reflected in the pages displayed.
You could try installing the Amazon Link Extra - Spoof Locale plugin and changing the locale that should be displayed by adding ?spoof_locale=uk to the url, e.g. http://www.tripinsiders.net/?spoof_locale=uk
Paul
Hi Paul,
Yes, I can see that ip2nation is detecting the country with no problem. Why would the plugin use all the time the link to US? I have tried from different countries (using proxies and remote desktop) and there is no change at all. It was working ok some time ago so I suspect it was an update.
Can you give a hint of where to debug or try to find the problem?
Cheers
Hi Paul,
Could you please let me know the file and/o function where the country is detected and the default link rendered so I can debug it?
Cheers
I am using cloudflare. Could this be the root cause of the problem?
So yes I found that Cloudflare was the problem, as ip2n->get_cc() was returning ‘eu’. As a quick fix, I enabled GeoLocation on Cloudflare and I changed amazon.php to use $_SERVER[“HTTP_CF_IPCOUNTRY”] (set by Cloudflare) instead of ip2n.
Excellent work, sorry I could not be more help (busy at work), I’ll investigate building that into the plugin.
Paul
I think a simple configuration such as “Use Cloudflare GeoLocation HTTP header” would do it. You then use ip2n->get_cc() or $_SERVER[“HTTP_CF_IPCOUNTRY”] accordingly
Hi Paul,
I just upgraded the plugin and I lost the fix for cloudflare. Are you planning to include it?
Cheers
Hi Paul,
I just saw you actually added it. I think you need the following correction:
strtolower($_SERVER[“HTTP_CF_IPCOUNTRY”]);
Cheers
Hi, Sorry – I don’t use cloud flare so did not test the fix, but I’ll put your change into the next version of the plugin.
Paul