Answer the question
In order to leave comments, you need to log in
How to detect country and automatically select values from select?
Hello everyone) There is such a task. How to determine the country of the site user and immediately select this country in select. Let's say there is a landing page for some product. There is a select with a choice of the country. When choosing a country, the price of the goods dynamically changes to the desired currency. Maybe someone has a ready script. Thanks for the help.
Answer the question
In order to leave comments, you need to log in
Yandex to help: codepen.io/SynCap/full/oBjrpv
Free, completely in the browser, no shamanism on the server side.
PS: if I'm not mistaken, then the currency code in the same request can be obtained, and if you conjure a little, then the current exchange rate. How to cram into Select, I suppose, you don’t need to learn, if anything - a list of all countries: https://ru.wikipedia.org/wiki/List_of_countries
Buy a maxmind database or download maxmind lite
Determine the country by ip address, of course, all this is on the server
Something similar, only here the city is determined and the phone number changes.
codepen.io/qwerqwer/pen/zNWrOz
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question