| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Determine the customer country from the IP address | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Determine the customer country from the IP address
Important!: This feature is implemented in all new xcart versions, so my work on this is discontinued.
This modul recognizes the customer country and chooses the right language for him. In the combination with the Multi_Currency module it sets the right currency as well. Country page in admin mode is slightly modified and you can choose a proper language for the country (for example, country San Marino - language Italian). As the data file is bigger than 512 kb I had to split it in separate files. Please, unpack everything, open "ip_range_1.sql" from "ip-range_1.zip", copy the text and paste it at the end of "sql/x-ip_range.sql" file from "x-iprange-4.1.7.zip file". Do it again with "ip-range_2.sql". All ip range data is completely updated and 2 new countries will be added: 1. Serbia 2. Montenegro All changes are visible in the admin area at the "countries" page. http://www.smee.hr/skin1/images/xcart%20forum/ip_range_admin.jpg and on the statistic page: http://www.smee.hr/skin1/images/xcart%20forum/ip_range_statistic.jpg For all problems send a post here or email to me. Important! If you want to use it with Multi_Currency module, you have to install the IP_Range module first! If you miss to do that you have to change line 67 in include/data_cache.php from PHP Code:
PHP Code:
New version uploaded 08/04/2008 - fixed error "FAILED] Table 'mydatabasename.tmp' doesn't exist" and upgraded to 4.1.9 version. Tested with freshly installed 4.1.9 version. New version uploaded 10/04/2008 - fixed error with no displaying default currency in the country management New version uploaded 13/04/2008 - robots are excluded from the list and included in a separate table New version uploaded 16/04/2008 - fixed error "Table 'xcart_stats_robots' doesn't exist"
__________________
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 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Determine the customer country from the IP address
What happens if you are in a country but don't speak that language?
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
Quote:
You mean, if the customer doesn't speak the langauge which is usually spoken in the country where he's browsing from? Nothing, he will have to choose another language from the language menu.
__________________
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 |
|||||||
#4
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
would it be possible if we can redirect customer with certain ip to different page on site using this mod.
regards Junaid
__________________
xcart 4.18 on linux |
|||||||
#5
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
Quote:
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:
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 |
|||||||
#6
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
getting this error during installation
FAILED] Table 'mydatabasename.tmp' doesn't exist Thanks Randy
__________________
X-Cart Gold 4.1.9 |
|||||||
#7
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
You'd actually be better off using the GeoIP service for that, however I should note that those types of lists are not generally accurate due to how often IP blocks are sold and resold and information is not updated. In either case the GeoIP service from Maxmind is better (there's a PHP extension for it).
An example is GeoIP says I live in Los Angeles California when in fact I do not but that's because the IP's delegations belong to MegaPath which is in LA. |
|||||||
#8
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
Quote:
I will check it tomorrow morning, you can expect the patch tomorrow. Regards, virtual@croatia
__________________
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 |
|||||||
#9
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
Quote:
If you want to use this modul just for the statistic, than it's better to use some external tool, for example GeoIP. But, the difference between this modul and external tool is that you can use this data in php and generate pages depending of the user country. For example, if you have multilanguage site, this modul will choose the right language depending of the user country and in combination with multicurrency modul, which you can find on the same forum, it will choose the right currency for the user. You can see how it works on my web site www.smee.com. If you are coming on the web site from US, the language will be English and the currency will be US$. If you are coming from Germany, the language will be German and the currency EUR. Regards, virtual@croatia
__________________
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 |
|||||||
|
#10
|
|||||||
|
|||||||
Re: Determine the customer country from the IP address
Quote:
Fixed! Please download the last version from the top post of this thread. Regards, virtual@croatia
__________________
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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|