Post by Zombay » Mon Nov 14, 2016 7:51 am

Is there a build-in PHP-function for detecting customer's country in OpenCart 2.3.x?

I see the country-codes are saved as "iso_code_2" and "iso_code_3" in "country" -table.
I need to auto-detect the same iso-codes when customer arrives to webpage, so I can build a script what tells customer do we have delivery to his/her country.

Newbie

Posts

Joined
Mon Nov 14, 2016 7:45 am


Post by willows » Tue Nov 15, 2016 8:27 pm

Zombay wrote:Is there a build-in PHP-function for detecting customer's country in OpenCart 2.3.x?

I see the country-codes are saved as "iso_code_2" and "iso_code_3" in "country" -table.
I need to auto-detect the same iso-codes when customer arrives to webpage, so I can build a script what tells customer do we have delivery to his/her country.
Are you looking to detect the country before they enter their billing address at the checkout.
If so you are looking then to match off on ip address. There are free ip address matchup databases but these are only 70% accurate. The most accurate ones are saas.

regards
Sean

Available for hire for maintenance, installs, hacks, SEO disasters, and integrations with epos, logistics and accounts systems.
Opencart Developers Ireland
Image


User avatar
New member

Posts

Joined
Sun Mar 17, 2013 5:19 am
Location - Dublin Ireland


Post by Johnathan » Tue Nov 15, 2016 11:05 pm

If you want an extension that does a geo IP lookup, I have a Geo IP Tools extension that can do that. You could then either use something like Rule-Based Banners to show a banner based on the customer's geo IP location, or manually build something that displays a message to the customer based on their location.

Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Zombay » Fri Nov 25, 2016 6:57 am

"Are you looking to detect the country before they enter their billing address at the checkout."
Yes, I would like to know visitors country when they 1st. time arrive to the site.
Then the country's ISO_CODE_2 is saved to cookie (and visitors also have option to change the country if they want).

I want to build this script so my customers will know right away do I ship to their country or not.

There is the "World Map" in the Dashboard. Can I somehow use it at the frontend?

Newbie

Posts

Joined
Mon Nov 14, 2016 7:45 am
Who is online

Users browsing this forum: No registered users and 30 guests