Got it 👍 — PrestaShop has a Geolocation feature that lets you restrict access to your shop (or payment methods) based on the customer’s country, using MaxMind’s GeoLite2 database.
Here’s a clear step-by-step guide to configure it:
⚙️ Steps to Configure Geolocation in PrestaShop
1. Enable Geolocation
- Go to your Back Office.
- Navigate to:
Shop Parameters
→Traffic & SEO
→ Geolocation tab (in PrestaShop 1.7/8).
(In older versions:Preferences
→Geolocation
) - Enable “Geolocation by IP address”.
2. Download MaxMind Database
- PrestaShop needs a database to detect IP locations.
- Download GeoLite2 City (free) from MaxMind:
👉 https://dev.maxmind.com/geoip/geolite2-free-geolocation-data - Extract the file
GeoLite2-City.mmdb
. - Upload it to your PrestaShop
/app/Resources/geoip/
directory (for PS 1.7/8).
(Older versions:/tools/geoip/
)
3. Configure Behavior
Under Geolocation options, set how your shop behaves:
- Countries with restrictions
- Choose countries that cannot access your shop.
- Behavior for restricted countries
- Visitors cannot see catalog (completely blocked, shows an error message).
- Visitors can see catalog but cannot order (browse only, no checkout).
4. Whitelist / Blacklist Countries
- You can allow or block specific countries.
- Useful if you want to sell only in a few regions.
5. Whitelist IP Addresses
- Add your own IP and trusted IPs in Whitelist (so you don’t get locked out while testing).
6. Save Settings
- Click Save.
- Test using a VPN to check from different countries.
🔧 Troubleshooting
- If geolocation doesn’t work:
- Make sure
GeoLite2-City.mmdb
is in the correct folder. - Enable PHP cURL or allow_url_fopen on your server (needed to read IP data).
- Clear PrestaShop cache.
- Make sure
- If too strict, some real visitors may get blocked (use catalog-only mode for safer setup).
✅