PrestaShop Documentation, PrestaShop Tutorials

Prestashop how to enable geolocation and use it

Alright, let’s turn PrestaShop Geolocation from “mystery toggle” into something actually useful 🌍😉
I’ll walk you through enable → configure → real-world use cases.


✅ What is Geolocation in PrestaShop?

Geolocation detects a visitor’s country (and sometimes region) using their IP address.

You can use it to:

  • Restrict access by country
  • Redirect users
  • Show different prices/taxes
  • Enable/disable shipping or payments
  • Comply with legal rules

🔹 Step 1: Enable Geolocation

Back Office Path

International → Localization → Geolocation

Settings

  1. Geolocation by IP address → ✅ Yes
  2. Geolocation behavior for restricted countries
    Choose one:

    • ❌ Visitors cannot see your catalog
    • ⚠️ Visitors can see catalog but cannot order
  3. Whitelist IP addresses
    👉 Add your own IP (important for testing)

    https://whatismyipaddress.com
    
  4. Click Save

🔹 Step 2: Download & Activate GeoLite Database

PrestaShop uses MaxMind GeoLite2.

Do this:

  1. Click Download the geolocation database
    (button is on the same page)

OR manually upload:

/app/Resources/geoip/
or
/tools/geoip/

Required file:

GeoLite2-Country.mmdb

💡 Without this file, geolocation will NOT work.


🔹 Step 3: Enable Country Restrictions

Go to:
International → Locations → Countries

For each country:

  • Enabled → Visitors can browse/order
  • Disabled → Restricted by geolocation

Example:

  • Enable: India, UAE
  • Disable: Other countries

🔹 Step 4: Enable Required Modules

Check these modules are enabled:

  • ps_geolocation
  • ps_facetedsearch (optional, for filters)
  • ps_currencyselector
  • ps_languageselector

Path:
Modules → Module Manager


🔹 Step 5: Real-World Uses (Most Important Part)

🧭 1. Restrict Orders by Country

  • Disable countries you don’t ship to
  • Choose “Catalog only” mode for restricted countries

👉 Common for B2B stores


💰 2. Automatic Tax Calculation

Enable:
International → Taxes

  • Enable tax rules by country
  • Tax is applied based on detected country

✔️ Works well for VAT / GST logic


🌐 3. Currency & Language Auto-Selection

PrestaShop can:

  • Auto-switch currency
  • Auto-switch language

Path:
International → Localization

  • Set default language & currency per country

🚚 4. Shipping Rules by Country

Path:
Shipping → Carriers

  • Assign carriers to specific countries
  • Hide shipping methods automatically

🔁 5. Redirect Users (Advanced)

Example:

  • India → /in/
  • UAE → /ae/

Needs:

  • Override or custom module
  • .htaccess or hook actionFrontControllerInit

(Ask me if you want ready code for this 👌)


🔹 Step 6: Testing Geolocation

Best ways:

  1. Use VPN (India / US / EU)
  2. Use proxy IP
  3. Temporarily disable your country

⚠️ Remember:

  • Add your IP to Whitelist
  • Clear cache after changes

⚠️ Important Notes

  • Geolocation ≠ 100% accurate
  • Doesn’t work well on:
    • Mobile networks
    • VPN users
  • Always allow manual country/language selection

✅ Quick Checklist

✔ Geolocation enabled
✔ GeoLite database installed
✔ Countries configured
✔ Cache cleared
✔ Modules enabled


 

About zohaibk

We develop useful addons for #E-Commerce and #CRM software to provide extra features.#PrestaShop,#Magento,#SugarCRM,#Vtiger & #Android #apps
View all posts by zohaibk →