Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
To begin with, create all possible address options for the store and with cities (if you still write all the code where and how to use models, controllers and display, there will be a lot of text), and already add ip check to the controller code:
$geoposition = file_get_contents( ' api.sypexgeo.net/json "your user's ip will be here"');
$geoposition = json_decode($geoposistion);
From the result, pull out the name of the city and compare it with what you have in the database and display the desired address on the page, I think it will not be difficult
There is a geoip pro module like for opencart, it costs 700r. The FIAS base of cities and regions is already sewn into it.
It has such a thing as a geomessage depending on the region, city, geofence.
And then it’s easier than ever in a controller or even in a tpl, you can make correspondence if a geomessage is such and such, display such and such an address ...
If without third-party modules, then configure geofences, add a correspondence table for IP address and phone number, and do the check in controller.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question