Answer the question
In order to leave comments, you need to log in
How to define a city?
Good day. I want to do as in the screenshot, so that there would be a choice of the city, not necessarily even automatically, you can do it manually, and after choosing the city, the selected city was in the woocommerce order. It is desirable to do something else so that, depending on the city, the phone number also changes. Please tell me how to implement
Answer the question
In order to leave comments, you need to log in
For city detection, the easiest way is to take https://sypexgeo.net/en/docs/
You can also make a pop-up window yourself.
We write the selected city (automatically or manually) in the cookie so that there is no need to detect the user on each request.
On the server, when placing an order, we put down the city from cookies.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question