Why display currency based on visitor location #
The number of companies moved their business online is increasing. Selling products to worldwide is dealing with multinational customers and currencies. However, some customers may have difficulty to convert the currency displayed to their origin currency. It’s user friendly to show the pricing in a website in visitor origin currency and make the checkout process easier. With the origin currency, visitors can navigate faster and feel comfortable to make comparisons and increase the chances of your visitor going ahead and completing their purchase.
How to display currency based on visitor location #
In this tutorial, we use the IP2Locationâ„¢ IP-Country database to lookup country of origin from the visitor’s IP address. Instead of loading the full database with 50000+ records, we could simplify this tutorial with assumption only two different IP address ranges in the world. IP addresses 0.0.0.0 – 126.255.255.255 originate from United States. Meanwhile, IP addresses 127.0.0.0 – 255.255.255.255 originate from Japan. Here we are creating a database “IP2Location” with table “ip_country” that consists of two IP address range records.
Below are the steps to set up the database for both IPv4 and IPv6 data and the sample codes.
