Geolocation Add-on

Learn how to install and use the add-on to automate the customer address determination.

Olga Tereshina avatar
Written by Olga Tereshina
Updated over a week ago

To improve the user experience of non-logged-in store visitors, you can facilitate customer location determination by IP by installing the X-Cart team's Geolocation add-on.

Geolocation is involved in many X-Cart features. For example, it enables your store to “guess” the non-logged-in customer's location for a more precise pre-login shipping cost estimation. In addition, the add-on provides a way for X-Cart to use a downloadable IP address database by MaxMind, an industry-leading IP intelligence provider.

By default, X-Cart uses the MaxMind’s GeoLite database (GeoLite2-Country.mmdb), enabling the store to identify a customer's location to a country level. If necessary, you can install a more advanced MaxMind database (free or paid) via the add-on settings.

To start using geolocation facilities in your X-Cart store, ensure that the Geolocation add-on is installed and enabled.

X-Cart 5.4

X-Cart 5.5


We also recommend checking the PHP configuration on your store server or having your hosting provider support team check it for you.

The Geolocation add-on requires PHP OPcache extension for its operation, and it is essential that you adjust the following PHP OPcache configuration parameters follows:

opcache.use_cwd=1 
opcache.revalidate_path=1
opcache.validate_timestamps=1
opcache.revalidate_freq=0

To check and adjust your store’s geolocation settings, proceed to the add-on settings page in your X-Cart store Admin area.

The following settings are available:

  • Default geolocation provider: The default database provider.

  • Display location select widget: This setting toggles the location select widget in the storefront header.


    Important: With the Crisp White skin, if the store provides multiple currencies for a customer to select from, they can specify the location via the widget only. That may be the case if the store has the add-on Multicurrency installed and enabled.

    If a store has only one currency and one language enabled, the widget will not be displayed. If the store has a single currency and more than one language enabled, the widget will display the customer’s country as identified automatically based on the IP address but will not provide controls to change location.


  • Upload extended database: You can upload an extended .mmdb database to identify a user’s location by IP more accurately.

    MaxMind provides the following database options:

    • GeoLite2 databases (free)
      You can use the GeoLite2-Country database to identify a customer’s location to the country's level automatically displayed on the cart and checkout pages. If you need a higher level of geolocation accuracy, you can switch to a free GeoLite2-City database that estimates a customer's location to a city. Both databases also narrow down the shipping rates offered to customers before they specify the current address at checkout.

      • Cart page

      • Checkout page (country)

      • Checkout page (city)

    • GeoIP2 databases (paid)
      If you need more options, try one of the paid GeoIP2 databases. Note that paid MaxMind GeoIP2 databases are more accurate than GeoLite2 databases.
      To upload a new database:

      • download a zipped database package from maxmind.com;

      • unpack the database archive to access the .mmdb file;

      • upload the .mmdb file to your store through the "Choose file" option in the "Upload extended database" field.


        If necessary, after uploading an extended database, you can revert to the default GeoLite2-Country database using the "Revert to using the default database" option below the "Database file in use" field value.


  • Database file in use: The field shows the database file currently in use by the Geolocation add-on.


    In case a country is disabled in your store's Admin area (Countries, States, and Zones > Countries), the Geolocation add-on will display the first available country in the list.



Related pages:

Did this answer your question?