View Single Post
  #5  
Old 03-05-2008, 02:02 AM
 
virtual@croatia virtual@croatia is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 92
 

Default Re: Determine the customer country from the IP address

Quote:
Originally Posted by junaid
would it be possible if we can redirect customer with certain ip to different page on site using this mod.
regards
Junaid

It is not included right now, but it is very easy to add this feature. At the beginning of the page modules/IP_Range.php are two rows which recognizes the user country:

PHP Code:
$ip_addr $_SERVER['REMOTE_ADDR'];
$ip_country func_query_first_cell ("SELECT iso2 FROM $sql_tbl[ip_ranges] WHERE $sql_tbl[ip_ranges].start <= INET_ATON('$ip_addr') AND $sql_tbl[ip_ranges].end >= INET_ATON('$ip_addr') LIMIT 1"); 


After this line you can redirect the user wherever you want depending the $ip_country variable.
__________________
Check what you can do with x-cart 4.1.9:
www.smee.com

Modules I made:
IP_Ranges
Multy_Currency
Order_Dates

Modules I use:
Fancycategory
Magnifier
Survey
AOM
Reply With Quote