Skip to content

City Lookup

developeregrem edited this page Feb 23, 2022 · 3 revisions

When creating or editing an address for a customer the hotel management tool has an automatic city lookup based on a given postal code implemented. When entering a postal code a list with cities is displayed and when selected the city field will be filled.

In order to use this function a database for your country or other countries must be manually imported.

At the moment databases from the geonames project are supported. Please pick one or more countries you wish to import and download them from here: http://download.geonames.org/export/zip/

Afterwards, extract the zip file to e.g. the root folder of the fewohbee installation (e.g. /opt/data/fewohbee).

Next, go to the fewohbee root folder and execute the build-in command to do the import (e.g. with cities of germany).

php bin/console app:import-postalcodedata "DE/DE.txt"

... or when using fewohbee-dockerized

docker-compose exec --user www-data php /bin/sh -c "php fewohbee/bin/console app:import-postalcodedata fewohbee/DE/DE.txt"

Update

If you want to update the database with a newer version of the genonames database please add the --override option to the command:

php bin/console app:import-postalcodedata "DE/DE.txt" --override