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 add-on Geolocation.

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 add-on Geolocation is installed and enabled.

We also recommend checking the PHP configuration on your store server or having your hosting provider support team check it for you. The add-on Geolocation 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 selector in the storefront header.

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

    The widget will not display in a store with only one currency and one language enabled. However, if the store has more than one language with a single currency, the widget will display the customer's country as identified based on the IP address. Still, it 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 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 specifying the current checkout address.

      • 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;

      • 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.

If you enabled the "Geolocation" add-on in your store, the storefront language will change automatically based on the customer IP provided the language-country dependency is set on the "Languages" page of your store's Admin area (Store Setup -> Translations).

Related pages:

Did this answer your question?