Country-Specific Pricing in Odoo
by Dharmesh Patel
In the global marketplace, businesses often have to price products for different regions. Setting up country-specific price lists can help tailor your prices based on local market conditions, currencies, and taxes, ultimately helping you optimise your sales strategy. This article shows you how to configure a country-specific and geo-location-based price list in Odoo for your website. By following the outlined steps, you’ll be able to create custom pricing for different countries, ensuring that your customers see the prices relevant to them.
Steps to Configure Country-Specific Pricelists
Step 1: Install GeoIP Library on the Server
Odoo uses MaxMind's GeoIP database to detect the user's location. You need to install the geoip2 Python library and download the GeoIP database.
1. Install the required GeoIP package on your server:
sudo pip3 install geoip2
2. Download the GeoIP Database: Odoo requires the GeoLite2 database for location detection. You can download it from MaxMind:
- Visit MaxMind's GeoLite2 Database.
- Download the GeoLite2-City database (you may need to create an account).
- Once downloaded, extract it to a directory like /usr/share/GeoIP/.
Example commands:
wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
tar -xzvf GeoLite2-City.tar.gz
sudo mkdir -p /usr/share/GeoIP/
sudo mv GeoLite2-City.mmdb /usr/share/GeoIP/
Step 2: Configure Odoo to Use the GeoIP Database
Now that the GeoIP database is installed on the server, Odoo needs to be configured to use it for detecting user location.
- Edit the Odoo configuration file (typically located at /etc/odoo/odoo.conf or /etc/odoo.conf depending on your setup).
Open the configuration file in a text editor:
sudo nano /etc/odoo/odoo.conf
2. Add the path to the GeoIP database: Add the following line to point to the location of the GeoIP database:
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
3. Save and exit the configuration file.
Step 3: Restart Odoo Service
After updating the configuration, restart the Odoo service to apply the changes:
sudo systemctl restart odoo
Step 4: Enable Pricelists and Multi-Currencies
- Go to: Settings > Website
- Enable Pricelists: Toggle on the option "Pricelists."
- Enable Multi-Currency (if needed): Go to Settings > Accounting and enable multicurrency if you plan to have different currencies for different countries.
Step 5: Configure Pricelists by Country
With your configurations in place, you can now create country-specific price lists.
1. Go to Website > Configuration > eCommerce > Pricelists
2. Create a new Pricelist
- Click on Create.
- Give your pricelist a name, such as "USA Pricelist" or "UK Pricelist."
3. Add Rules to the Pricelist
- Add specific pricing rules based on products, categories, or brands.
- You can create rules for discounts, price increases, or fixed prices. These rules allow you to tailor pricing to specific markets and customer needs.
4. Assign Country Group to the Pricelist
- Under the Country Group field, select the group of countries or a specific country to which this pricelist applies.
- If needed, you can create country groups under Settings > Contacts > Configuration > Country Groups.
Step 6: Test Your Setup
Once your configuration is complete, testing whether it’s working as expected is important.
- Visit your website in incognito mode or use a VPN to simulate different countries/locations.
- Ensure that the correct price list is applied based on the geo-location or country.
Wrap-Up
Setting up a country-specific price list in Odoo is a powerful way to customise pricing for different markets. By following this step-by-step guide, you’ll be able to optimise your pricing strategy, cater to regional customer demands, and enhance the user experience on your eCommerce website. Testing is crucial, so make sure to validate that everything is functioning correctly based on the user's location.
Maximise Your Odoo ERP Experience
Stay tuned to our blog for more useful tips!