- Posts: 47
- Thank you received: 4
Geolocation plugin doesn’t work properly
11 years 6 months ago - 11 years 6 months ago #195242
by amigo
Geolocation plugin doesn’t work properly was created by amigo
-- HikaShop version -- : latest
-- Joomla version -- : 3.4
-- Browser(s) name and version -- : Any
Good day to you,
Geolocation plugin doesn’t work properly. I configured plugin in such way, so it shows prices in USD everywhere but Ukraine. In Ukraine prices are shown (or at least should`be seen) in UAH (Ukrainian Hryvna).
But, some of my friends and customers (from Ukraine. For example, one of their IPs is 93.183.206.171) already told me, that they see prices in USD.
Please advice something.
-- Joomla version -- : 3.4
-- Browser(s) name and version -- : Any
Good day to you,
Geolocation plugin doesn’t work properly. I configured plugin in such way, so it shows prices in USD everywhere but Ukraine. In Ukraine prices are shown (or at least should`be seen) in UAH (Ukrainian Hryvna).
But, some of my friends and customers (from Ukraine. For example, one of their IPs is 93.183.206.171) already told me, that they see prices in USD.
Please advice something.
Last edit: 11 years 6 months ago by amigo.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #195295
by nicolas
Replied by nicolas on topic Geolocation plugin doesn’t work properly
Hi,
I've done a test on your website and the geolocation works fine:
take.ms/la1VV
When I use a ukrainian web proxy, I see the price in UAH, and when I directly access the link (I'm based in France) I see the price in EUR.
I've also tested the IP you provided on the geoplugin website and it finds the correct country: take.ms/zxuvV
So I don't see why it wouldn't work.
Are you sure that your friends/customers are not using a proxy or VPN on their computer ? That could explain why they get the prices in another currency. It would just mean that the VPN or proxy server is located outside of Ukraine, and you can't do much about that.
I've done a test on your website and the geolocation works fine:
take.ms/la1VV
When I use a ukrainian web proxy, I see the price in UAH, and when I directly access the link (I'm based in France) I see the price in EUR.
I've also tested the IP you provided on the geoplugin website and it finds the correct country: take.ms/zxuvV
So I don't see why it wouldn't work.
Are you sure that your friends/customers are not using a proxy or VPN on their computer ? That could explain why they get the prices in another currency. It would just mean that the VPN or proxy server is located outside of Ukraine, and you can't do much about that.
Please Log in or Create an account to join the conversation.
11 years 6 months ago - 11 years 6 months ago #195349
by amigo
Replied by amigo on topic Geolocation plugin doesn’t work properly
We checked VPN/proxy usage, no it wasn`t used.
Today one more friend said, that he sees price in dollars. His IP is 192.168.3.172, at least that`s what shows hikashop, while I check comments, left by him. But, site for IP checking indicates, that his IP is 93.183.206.171 (whatismyipaddress.com/).
Moreover, are you sure, that you see prices on our site in Euros?
Today one more friend said, that he sees price in dollars. His IP is 192.168.3.172, at least that`s what shows hikashop, while I check comments, left by him. But, site for IP checking indicates, that his IP is 93.183.206.171 (whatismyipaddress.com/).
Moreover, are you sure, that you see prices on our site in Euros?
Last edit: 11 years 6 months ago by amigo.
Please Log in or Create an account to join the conversation.
11 years 6 months ago - 11 years 6 months ago #195364
by Xavier
Replied by Xavier on topic Geolocation plugin doesn’t work properly
Hi,
You friend seems to be on the same network than the one where the website is hosted.
Don't really know how that's possible, but this is the more logical reason.
The IPs starting with 192.168.xx.xx are local IPs not global ones.
So the geolocation plugin can't see from where he is coming.
You friend seems to be on the same network than the one where the website is hosted.
Don't really know how that's possible, but this is the more logical reason.
The IPs starting with 192.168.xx.xx are local IPs not global ones.
So the geolocation plugin can't see from where he is coming.
YesMoreover, are you sure, that you see prices on our site in Euros?
Last edit: 11 years 6 months ago by Mohamed Thelji.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #195608
by amigo
Besides, he is not the one in Ukraine, who encountered prices in USD.
And what should I do with all those geolocation problems?
Replied by amigo on topic Geolocation plugin doesn’t work properly
Don`t you think that it may be a bug? Because, different srvices for IP checking in the Internet did show IP 93.183.206.171 as his IP.You friend seems to be on the same network than the one where the website is hosted.
Don't really know how that's possible, but this is the more logical reason.
Besides, he is not the one in Ukraine, who encountered prices in USD.
"Why is that? Prices should be shouwn to you in USD, shouldn't they?Yes
And what should I do with all those geolocation problems?
Please Log in or Create an account to join the conversation.
11 years 6 months ago #195638
by Xavier
Replied by Xavier on topic Geolocation plugin doesn’t work properly
Hi,
I looked at the plugin code and to get the user ip we call this function:
So this is the common way to get the user IP thanks to PHP.
Then based on that ip, we get the zone of the user.
So if the returned IP is not correct, we take the shop zone (main zone).
You could potentially try to replace the content of the function hikashop_getIP() in "administrator/components/com_hikashop/helpers/helper.php" by another script to get the user ip, but I really think that this is the best way of doing that.
What can be tried to, is to add this code on another HikaShop view in order to see if at this place the returned ip is correct or not.
If it is correct, so the IP is edited at another place...
Please keep us informed of the results of your tests.
I looked at the plugin code and to get the user ip we call this function:
Code:
function hikashop_getIP(){
$ip = '';
if( !empty($_SERVER['HTTP_X_FORWARDED_FOR']) && strlen($_SERVER['HTTP_X_FORWARDED_FOR']) > 6){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}elseif( !empty($_SERVER['HTTP_CLIENT_IP']) && strlen($_SERVER['HTTP_CLIENT_IP']) > 6){
$ip = $_SERVER['HTTP_CLIENT_IP'];
}elseif(!empty($_SERVER['REMOTE_ADDR']) && strlen($_SERVER['REMOTE_ADDR']) > 6){
$ip = $_SERVER['REMOTE_ADDR'];
}
//We add a strip tags here as the ip could definitely be modified by something...
return strip_tags($ip);
}
Then based on that ip, we get the zone of the user.
So if the returned IP is not correct, we take the shop zone (main zone).
You could potentially try to replace the content of the function hikashop_getIP() in "administrator/components/com_hikashop/helpers/helper.php" by another script to get the user ip, but I really think that this is the best way of doing that.
What can be tried to, is to add this code on another HikaShop view in order to see if at this place the returned ip is correct or not.
If it is correct, so the IP is edited at another place...
Please keep us informed of the results of your tests.
The following user(s) said Thank You: amigo
Please Log in or Create an account to join the conversation.
11 years 6 months ago #196833
by amigo
Replied by amigo on topic Geolocation plugin doesn’t work properly
Good day to you,
But you didn't answer why are prices shown in EUROs instead of USD.
But you didn't answer why are prices shown in EUROs instead of USD.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #196865
by nicolas
Replied by nicolas on topic Geolocation plugin doesn’t work properly
The prices are shown in EUR because you must have configured either the main currency as EUR or the currency of France to EUR.
If you want the prices to be in USD for France, then select that currency in that zone when you edit it via the menu System>Zones.
If you want the prices to be in USD for France, then select that currency in that zone when you edit it via the menu System>Zones.
The following user(s) said Thank You: amigo
Please Log in or Create an account to join the conversation.
Time to create page: 0.253 seconds