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.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.
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
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.
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.
"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?
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?
Who is online
Users browsing this forum: Semrush [Bot] and 100 guests