I have a website and I would like to include a PayPal button so clients can purchase directly on the site, the only problem is that I need the same button to appear differently (with different prices & currencies) in different countries.
How do I do this?
I'd recommend using a Geolocation JavaScript code. However, the user would have to give permission when they load the page. You can have a look here: http://www.w3schools.com/html/html5_geolocation.asp
Or see example code:
You could then pass the lat and long data to an api to find the city/country they live in. Hope it helps!
PayPal will do currency conversion for you, but if you need to set different prices in different countries (ala mobile app stores), then you will have to create the different buttons yourself - one for each country/currency you wish to target. Then, based on locale or requesting URL, you will present the proper button's code.