IP Geolocation by MaxMind

Warning
Installation of the add-on requires advanced technical skills. It is created mainly for developers to use in further development.

What is the IP Geolocation by MaxMind?

The IP Geolocation by MaxMind add-on is a professional solution that adds the ability to determine the user’s location by IP address using the MaxMind databases.

MaxMind offers free and paid databases with the most up-to-date and accurate data available.

The advantages of the add-on are the following:

  1. Geolocation is determined at the server level without involving web browsers, which allows to offer content taking into account customer’s location at their first visit.
  2. Geodata is determined very quickly by local databases, it does not depend on external services.
  3. Extended data for multiple languages (country, region, city).

MaxMind’s Geolocation adds the following functionality:

The customer’s city will be determined and displayed in the header of the storefront.

IP Geolocation by MaxMind

If the city is not determined, this pop-up will be displayed:

IP Geolocation by MaxMind

After clicking Select city, a customer will be able to specify the city manually.

IP Geolocation by MaxMind

The country, region, city fields are auto-completed at checkout.

IP Geolocation by MaxMind

The store currency will be automatically set to the customer’s currency depending on their country.

IP Geolocation by MaxMind

The add-on allows to automatically determine the customer’s language in the store depending on their country.

IP Geolocation by MaxMind

Compatibility

The add-on is compatible with CS-Cart and Multi-Vendor 4.3 and above, but only versions 4.11.x, 4.12.x and 4.13.x are supported. PHP 7.1 and higher is required.

Support

This add-on is developed and published by Simtech Development Ltd., a CS-Cart developer. You are guaranteed a quality add-on supported by the future versions. If you need help, please contact us via our help desk system.

Maxmind Geolocation Demo

Check out the IP Geolocation by MaxMind add-on in our demo store.

Note
Every half an hour the demo store is reset to the default state.

Managing in the admin panel

Installing the add-on

Install the MaxMind Geolocation add-on on the add-ons list page (“Add-ons” → ”Manage add-ons”). Click the + button in the top right corner, select an archive and click Upload & install. You can now find the installed add-on in the list of installed add-ons, just make sure it is set to Active.

Available settings

The settings of the “IP Geolocation by MaxMind” add-on are divided in two sections:

  • General
IP Geolocation by MaxMind

  • Use city in user profile—if selected, the City field will be auto-complete during registration and at checkout.
  • Limit—count of cities that will be displayed in the drop-down list. By default, its value is set to 10.
  • Minimum length—minimum count of symbols that a user should enter before the drop-down list is displayed. By default, its value is set to 3.
  • Show predefined popup—if selected, a pop-up window will be displayed to confirm the determined city.
IP Geolocation by MaxMind

  • Set customer’s language—when a customer visits the store for the first time, the system will choose the language of the customer’s country (if it is installed)
  • Set customer’s currency—when a customer visits the store for the first time, the system will choose the currency of the customer’s country (if it is installed)
  • Databases
IP Geolocation by MaxMind

Follow the instructions to download the database archives from the MaxMind website and unpack them in the right directory. You should download these two archives:

  • city database
IP Geolocation by MaxMind

  • CSV file

Note that you should take the CSV file that corresponds to the language used in your store from the downloaded archive. For example, for the English language it’s the GeoLite2-City-Locations-en.csv file.

IP Geolocation by MaxMind

Once you add the necessary files, click Save.

Open the add-on settings again and go to the Databases tab. You should see the names of the added files. Click the Update db cities button to update cities in the database.

IP Geolocation by MaxMind

You will also see the IP for test search field added. This field is for testing purposes. Enter any IP address into the field to see the country and city of the entered IP address. For example:

IP Geolocation by MaxMind

Click Save.

Adding a block for the determined city

If you want to display a block with the determined city for customers in the storefront, follow these steps:

IP Geolocation by MaxMind

  1. In the admin panel, go to Design – Layouts.
  2. Locate the Top panel and add a new block by clicking the + button.
IP Geolocation by MaxMind

  • In the pop-up window, go to the Create New Block tab and select the corresponding block.
IP Geolocation by MaxMind

  1. In the block settings, name the block and click Create.
  2. Make sure the block appeared in the layout.
IP Geolocation by MaxMind

  1. Open the Block Settigs taband edit the pop-up show settings
IP Geolocation by MaxMind

  1. Go to the storefront to see the created block.
IP Geolocation by MaxMind

Setting up currencies

With the IP Geolocation by MaxMind add-on, the store currency will be automatically set to the customer’s currency depending on their country.

IP Geolocation by MaxMind

To do this, go to Administration – Currencies and select the necessary currency from the list of existing currencies or add a new one by using the + button.

IP Geolocation by MaxMind

On the currency editing page, select the countries you’d like to set the currency for and move them to the left section.

IP Geolocation by MaxMind

Setting up languages

The IP Geolocation by MaxMind add-on allows to automatically determine the customer’s language in the store depending on their country.

IP Geolocation by MaxMind

To make this feature work for your store, check to make sure that you have all the necessary languages installed in your store. To do this, go to Administration – Languages – Manage languages.

IP Geolocation by MaxMind

If you do not have the required language on the list, switch to the Available tab and install the desired language by clicking the corresponding button.

IP Geolocation by MaxMind

The city is not in the database

When the city is determined and the user wants to change it, but it is not in the MaxMind database, they can enter their city and click My city is not in the list.

IP Geolocation by MaxMind

Then the user will be offered to enter the Country and State/Province for the city and click Add.

IP Geolocation by MaxMind

Once the city is added, a notice will be displayed:

IP Geolocation by MaxMind

The added city will also appear in the admin panel. Go to Website – MaxMind cities to see it:

IP Geolocation by MaxMind

It is recommended to translate the name of the city into the corresponding language.

Changing content of the block and pop-ups

It is possible to change the content of the Your city is block (displayed in the header of the site) and pop-ups (that appear in case the city is determined and not determined) by creating hooks.

Content of the block

IP Geolocation by MaxMind

  1. Navigate to [CS-Cart dir root]/design/themes/[your_theme]/templates/addons/.
  2. Create a my_changes/hooks/geoip/ folder.
  3. Create a block_content.override.tpl file in the folder.
  4. Insert these lines into the file:
{if $geo_select.city_description}
Your city is
{/if}
  1. Replace Your city is with the text you want to display.
  2. Clear the store cache via the admin panel.

Content of the pop-ups

  • city is determined
IP Geolocation by MaxMind

  • city is not determined
IP Geolocation by MaxMind

  1. Navigate to [CS-Cart dir root]/design/themes/[your_theme]/templates/addons/.
  2. Create a my_changes/hooks/geoip/ folder.
  3. Create a popup_content.override.tpl file in the folder.
  4. Insert these lines into the file:
{if $geo_select}
{__("your_city_is")} {$geo_select.city_description}. {__("correct_city")}? {* when the city is identified *}
{else}
{__("cant_detect_city")}. {__("specify_your_city")}? {* when the city is not identified *}
{/if}
  1. Replace the variables with the ones you want to display.
  2. Clear the store cache via the admin panel.

Share:
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.