/
GeoIP integration

GeoIP integration

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/434d04ebbb9746eb#

GeoIP is technology that allows to detect website visitors country based on
his IP address. Here are more info on how install it
http://php.net/manual/en/book.geoip.php

Once installed you have free database that allows you to match most of IP
addresses. Since database is free it's not updated very frequently and
there is no 100% accurate location detection based on IP address. Of
course buying fresh database from  http://www.maxmind.com/app/ip-location is
always an option.

In-Portal has table with all countries (used during user registration and
checkout) and In-Commerce has table with all currencies. I'm proposing to
do following:

   1. add CurrencyIsoCode column to countries table (will tell currency in
   that country)
   2. add Locale column to countries table (will tell primary communication
   language in that country)
   3. on first user visit (when no ip-to-location detection was made):
      1. detect country ISO based on user IP
      2. from country get currency ISO code and set it as default user's
      currency (of course if this currency is enabled on website)
      3. from country get language and set it as current (will conflict
      with language detection by "Accept-Language" header if enabled)

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com