virtual Posted November 8, 2010 Report Share Posted November 8, 2010 Hi All, I was wondering if someone could point me in the right direction. I need to display prices on a web page according to geographical location. E.g. If the client is in Europe I want to display the page with the prices in Euros and if he is in the US, display the page with prices in $. I know this is possible, but haven't a clue how to do it or what to search for specifically. Thanx in advance Quote Link to comment Share on other sites More sharing options...
jstern Posted November 8, 2010 Report Share Posted November 8, 2010 We use http://www.maxmind.com/app/ip-location (GeoIP) works pretty well, but i have to manually download / update the IP list monthly. There might be another way I haven't really looked into it. Quote Link to comment Share on other sites More sharing options...
virtual Posted November 8, 2010 Author Report Share Posted November 8, 2010 Thanks, that's a little overkill for me as it is a very small static site. I thought something like this could be done similar to browser sniffing, I only really need 2 possibilites, USA = $ and Europe = €. Quote Link to comment Share on other sites More sharing options...
jstern Posted November 9, 2010 Report Share Posted November 9, 2010 Well using the GeoIP you'd still need to get the clients IP, but you'll need a list of IP's to test against, which it provides. You could probably do some google searching for a list of GBP and/or EU IP addresses (for example 34.102.*.* could be a EU IP, so you'd have code that say if users IP in_array(list of Europe IP's) then display currency in pounds, else USD)) Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 9, 2010 Report Share Posted November 9, 2010 A lot of sites avoid using a list of IP addresses by simply using a splash page that asks the user to choose their location and then redirects them to the correct location (and often these sites provide a simple way of allowing the user to switch locations by changing the option in an upper corner of the website). You wouldn't necessarily need to create two different versions of the site to do this... You could use PHP to specify which version they should be viewing. For example, you could use a variable in the URL: yoursite.com/file.php?loc=us and then display the correct prices based on that variable. for example, if the url was yoursite.com/file.php?loc=us you could use PHP like this: <?php if ($_GET['loc'] == 'us') { echo "$9.99"; // display US price } else { echo "€8.99"; // display euro version } ?> Quote Link to comment Share on other sites More sharing options...
virtual Posted November 9, 2010 Author Report Share Posted November 9, 2010 Great idea Ben, that would make my life much easier. So I could leave all the site intact and have the price page as a splash page and just get them to choose the price page according to their location. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.