This is what I mean (e.g.):
Say store is based in UK, and base currency is GBP.
Store owner has also installed EUR and USD.
Then:
If a user is logged in, then default currency for that user (i.e. currency that appears unless user explicitly clicks on picker to change currency) is based on default (or last used) billing address.
e.g. if billing address is in Phoenix AZ, then currency USD
if billing address is Frankfurt am Main, Germany, then currency EUR
if billing address is New Delhi, India, then currency GBP (why? because INR is not installed and base currency of store is GBP)
If user is not logged in, then the default currency for that user is based on geographic location, as assessed from the IP address. There are lots of free services that convert IP to location, and many of them provide APIs. e.g. http://www.hostip.info/
The easiest one seems to be http://www.wipmania.com/en/api/
Code: Select all
http://api.wipmania.com/[IPADDR]?[URL]
IPADDR - queried IP address. For example, your visitor's address.
URL - your domain name. It will be used to control your daily limits.