PrestaShop includes Geolocation features that let you detect a visitor’s location based on their IP address and adapt your shop’s behavior accordingly. This is mainly useful for regional restrictions, pricing, tax rules, and compliance. Here’s a breakdown of the geolocation features:
🔑 Core Geolocation Features in PrestaShop
- Restrict Access by Country
- You can block access to visitors from specific countries.
- Useful for compliance (e.g., selling alcohol, regulated products, or legal restrictions).
- Redirect Customers Based on Location
- Detects the country of the customer’s IP address.
- You can redirect them to the correct store version (if you run a multi-store with multiple languages or currencies).
- Automatic Tax & Currency Settings
- Applies the correct tax rules (VAT, GST, sales tax) depending on customer’s country.
- Can auto-display the local currency when available.
- GeoIP Database Integration
- Uses the MaxMind GeoLite2 database (must be installed manually since PrestaShop 1.7+ due to licensing changes).
- Ensures accurate country detection.
- Granular Control for Products/Orders
- You can prevent orders from regions where you don’t ship.
- Helps avoid unwanted shipping or payment gateway mismatches.
- Fallback Options
- If a visitor’s IP cannot be geolocated, PrestaShop allows you to define a default country/currency.
⚙️ How to Enable Geolocation in PrestaShop
- Go to Back Office → Shop Parameters → Traffic & SEO → Geolocation.
- Enable Geolocation by IP address.
- Upload the MaxMind GeoLite2 database file (
GeoLite2-Country.mmdb
) into the/app/Resources/geoip/
directory. - Configure:
- Countries allowed/blocked
- Behavior for restricted IPs (show message, deny access, or redirect)
- Default country if location cannot be detected
📌 Practical Use Cases
- EU VAT compliance: Charge the right VAT based on the customer’s country.
- Multi-store setup: Redirect Indian visitors to your
.in
domain, US visitors to.com
. - Restricted goods: Block visitors from countries where shipping is not allowed.
- Fraud prevention: Compare the customer billing country with the detected IP country.