How to change the address depending on the city in therefore?

then depending on the change to the phone number and address. How it can be implemented on opencart?
June 14th 19 at 20:26
1 answer
June 14th 19 at 20:28
First, we create all possible locations for the shop and with the cities (if there are still writing all the code where and how to use the model, controller and display, will be a lot of text), and in the controller code to add validation on ip:
$geoposition = file_get_contents('"there will be the ip of your user"');
$geoposition = json_decode($geoposistion);
From the result to get the name of the city and compare with what you have to base lies and to display the desired address, I think not working
I meant it as realizoval in opencart. how to get the ip of the city is not difficult. I don't need of course the code itself. but the only General algorithm how to change city in opencart.
I do not quite understand, what's the model? I mean to change the read model from the database address? And then he will take the new address? Means it is necessary to create in a DB the table with cities and addresses?
Change the code in the engine work? or you can do this by creating a module - after all, where the same is necessary in the admin these address and city to add - Clementine.Beatty85 commented on June 14th 19 at 20:31
It is better to write a module installed via ocmod. So you can enable and disable this module. And Yes, you will need to create a table in database in which to store the addresses of the stores and the cities themselves - Lamont_Nikolaus commented on June 14th 19 at 20:34

Find more questions by tags OpenCartInternet shopsJavaScriptPHP