0

I'm looking for a way to get a message on my site that says: We ship to [Users country location]!

So I would need to retrieve the users Country location, without them having to accept any localization plugin or whatnot. Users using a proxy or whatnot will be extremely rare, so I don't worry too much about them. A default message may be (if no location can be found for whatever reason) We ship worldwide! or something similar.

Is there any easy way to go about this? My PHP and Javascript skills are very limited. I could find some documentation on retrieving a country name, but not on displaying it back to the customer.

Thanks in advance!

CrossY
  • 19
  • 5

1 Answers1

0

You can use something like Maxmind Geolite2 free database:

http://dev.maxmind.com/geoip/geoip2/geolite2/

It is updated on the first Tuesday of each month and it is distributed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.

There are a lot of API to use with this database, take a look here: http://dev.maxmind.com/geoip/geoip2/downloadable/#MaxMind_APIs

rvandoni
  • 3,297
  • 4
  • 32
  • 46