Knowledgebase
How to restrict access to your shop using Geolocation in PrestaShop 1.5-1.6
Geolocation is a PrestaShop feature with which you can restrict access to your shop for specific countries. You can select the countries that you want to restrict and configure the behavior of Geolocation towards customers from those countries, as well as from the countries that are not restricted. To access and configure the options for Geolocation, go to Preferences menu>Geolocation sub-menu in the admin panel of your PrestaShop.
In this article we'll briefly go over the process of enabling Geolocation and managing its settings. For screenshots and some more details you can also check out the tutorial on how to manage Geolocation in PrestaShop 1.5-1.6.
Geolocation File
In order to enable and use Geolocation, first you need to get a specific file which then you have to upload on your PrestaShop hosting account. When you go to Preferences menu>Geolocation sub-menu at the top of the page you'll see a message about that file. There's a link in the message; click on the link to download and save the file on your local computer. After you download the archive, unzip it and upload the unzipped file on your PrestaShop hosting account. If your PrestaShop is installed directly in the public_html directory on your account, the path to the folder in which you have to upload the file will be public_html/tools/geoip.
Enable Geolocation
Once you have the file uploaded on your hosting account you can enable Geolocation. Go to Preferences menu>Geolocation sub-menu in the admin panel, enable the option Geolocation by IP address and click on the Save button. If you don't want to use Geolocation anymore, simply disable the option.
Geolocation Options
Under the option for enabling Geolocation there are some options with which you can manage its behavior and select which countries should have access to your store.
By default, customers from any country can access your store. The option Select the countries from which your store is accessible is a list of all countries. If you want to restrict the access from a specific country, unmark the checkbox for that country in the list.
Above the list there are a couple of options. One is for managing the behavior for the restricted countries and the other for the countries for which access is allowed. For the restricted countries you can give access to the catalog (customers from those countries are not allowed to order), or you can hide the catalog completely. For the countries for which the access is not restricted you can hide the catalog, you can give access to the catalog without the option to order, or you can give access to all features.
If you make changes, don't forget to click on the Save button.
IP Address Whitelist
Below the options for the behavior of Geolocation there's a whitelist of IP addresses. The addresses in that list are allowed to access your store regardless of the country restrictions. If you want to add an address to the list, put it on a separate line and click on the Save button.
For screenshots and some more details you can also visit the tutorial on how to manage Geolocation in PrestaShop 1.5-1.6.