Price by Country, Shop & Currency: documentation
Create rules, understand price computation, simulate, recalculate, undo a recalculation and automate with cron.
Price by Country, Shop & Currency applies a margin coefficient and psychological rounding per market, then writes the result as native PrestaShop specific prices. This guide covers installation, rule creation, price computation, simulation, recalculation, undoing a recalculation and cron automation.
Installation and update
The module is compatible with PrestaShop 8.0 to 9.x, single store or multistore.
- In the back office, open Modules > Module Manager, click Upload a module and select the ZIP file.
- The module creates its tables, a DF Multi Price tab under Catalog and a cron token.
- Open the module configuration to set auto-apply, the batch size and to get the cron URL.
Coming from version 1.0.0? Recalculate your rules after updating, especially those bound to a currency other than the default one: 1.0.0 stored these prices in the wrong currency. Existing rules keep their behaviour, with “Price each combination” and “Keep active promotions” disabled. Enable them in each rule if needed.
Create a price rule
Open Catalog > DF Multi Price and click Add new rule. The form has four blocks.
Who sees this price
- Shop: one shop or all. With “All shops”, base prices are read from the default shop.
- Country: its VAT is used to compute the rounded tax-included price. A visitor without an address is attached to the default country of the shop, unless geolocation is enabled, and switching currency does not change the country. A rule for another country therefore only reaches customers with an address in that country. For a currency rule, keep “All countries”.
- Currency: create one rule per currency to control the ending in each one. With “All currencies”, the price is expressed in the default currency and PrestaShop converts it for the other currencies, which lose the ending.
- Customer group: for B2B price lists. Group discounts set in Customers > Groups still apply on top.
Which products
- Category: the category and all its subcategories, or the whole catalog.
- Brand: restricts the rule to one brand.
- Excluded products: product IDs separated by commas.
- Keep active promotions: see the dedicated section below.
How the price is built
- Price base: retail price tax excl. or cost price. With the cost price, products without one are skipped.
- Margin coefficient: price = base x coefficient. 1.20 adds 20%. Use 1 to apply the rounding only.
- Price each combination: recommended. Each combination gets its own price, impact included. Without this option, PrestaShop adds the combination impact after rounding and the ending is lost.
- Rounding: nearest ending, always up, always down, or no rounding.
- Psychological ending: x.90, x.95, x.99, x.50 or x.00.
- Rounding step: rounds to a multiple of a step instead of an ending. Available steps: 0.05, 0.10, 0.20, 0.25, 0.50, 1, 5 and 10. The direction follows the Rounding field: with 0.10 and Nearest, 23.47 becomes 23.50; with 10 and Always up, 23.47 becomes 30; with 10 and Always down, 20. When a step is selected, it replaces the ending. The price is never rounded to zero: it is at least one step. “None” (default) keeps the ending.
- Round the tax-included price: recommended for B2C. Disable it for B2B prices displayed tax excluded: the rounding then applies to the tax-excluded price.
Safety nets
- Minimum price: minimum displayed price, in the rule currency. 0 = no minimum.
- Minimum margin over cost: coefficient over cost price the price never goes below, for example 1.15. Applies to products with a cost price. 0 = disabled.
- Priority: lower values run first. When two rules target the same shop, country, currency and group, the first keeps the price and the other counts a conflict.
- Active: disabling a rule removes the prices it generated.
How the final price is computed
Rounding only makes sense on the amount shown to the customer. The engine follows this sequence:
- Base price tax excl. (combination included when the option is on) multiplied by the coefficient.
- Conversion into the rule currency at the shop exchange rate.
- Switch to tax-included with the rule country VAT, plus ecotax when enabled in PrestaShop.
- Rounding to the chosen ending, or to a multiple of the step when a rounding step is set.
- Minimum price, then minimum margin, both rounded up.
- Back to the tax-excluded price, stored in the rule currency.
Example: a base price of 69.99 excl. tax, a 1.20 coefficient, 19% VAT and an x.99 ending give 99.99 incl. tax in the shop.
PrestaShop reads a specific price bound to a currency in that currency, without conversion. This is why the module stores it directly in the rule currency: a rule in pounds sterling shows the amount in pounds computed by the rule.
Check a price in the shop
The Check a price in the shop panel above the rule list reproduces the PrestaShop computation for a given context. Enter a product ID, and a combination ID if needed, then choose the shop, the country (the shop’s default country by default), the currency and the group (Visitor by default). The panel shows:
- the country visitors without an address are attached to, and whether geolocation is enabled;
- the displayed price, tax excluded or included depending on the group;
- the specific price PrestaShop uses and its origin: module rule, price entered by hand or catalog price rule;
- the status of each rule: applied, other context (with the shop, country, currency or group it targets), product outside the rule, to recalculate, promotion kept, or overridden by another specific price.
The rule list also shows a warning when a rule targets a country other than its shop’s default country without geolocation, or when an “All shops” rule covers shops with different default countries.
Simulate before applying
In the rule list, the Simulate action opens a window showing, for the first targeted products, the current storefront price, the new price and the change in percent. Nothing is saved. Products left aside appear with their reason: active promotion or no base price.
The Export CSV preview action produces the full list (product ID, combination ID, reference, name, current price, new price, stored price tax excl., status) as semicolon-separated CSV readable in Excel.
Recalculate
- The Recalculate action of a rule applies that rule to the catalog.
- The Recalculate all active rules toolbar button chains the rules in priority order.
Processing runs in batches with a progress bar, then a summary:
- Created, Updated, Unchanged: prices written by the rule.
- Promotions kept: products left untouched because they are on promotion.
- Conflicts: prices already held by a higher-priority rule with the same dimensions.
- Skipped: products without a usable base price.
- Removed: prices deleted or given back to the merchant, for example for a product that left the rule scope.
A rule edited after its last recalculation shows the To recalculate badge in the list. The batch size (10 to 500 products) is set in the module configuration.
Undo a recalculation
Every recalculation, manual or cron, records the previous state of each price it touches. To go back:
- in the rule list, use the Undo last recalculation action;
- or, in the module configuration, click Undo in the history.
Undo deletes the prices created by the recalculation, restores the value of updated prices and recreates removed prices. It works in reverse order: the most recent recalculation first, then the previous one, up to 5 recalculations back per rule. An interrupted recalculation (window closed during processing) can be undone one hour after it started.
After an undo, the rule shows To recalculate, since prices no longer match its settings. Edit the rule if needed, simulate, then recalculate.
The rule must be active to undo its recalculation. Recalculations made with version 1.0.0 or 1.1.0 cannot be undone: undo works from the first recalculation made with 1.1.1.
Promotions and manual prices
PrestaShop applies a single specific price per product: the most specific one wins. A price per country and currency would therefore hide a broader promotion. With Keep active promotions, a product with an active reduction (not created by the module) is left untouched, then repriced by the first recalculation after the promotion ends. Schedule the cron so this happens automatically.
If a manual fixed price already exists with the same dimensions as the rule, with no reduction and no dates, the rule takes it over instead of creating a duplicate. Its original value is kept and given back when the recalculation is undone, when the rule is disabled or deleted, or when the module is uninstalled. Promotions and prices with other dimensions are never changed.
Automate with cron
The token-protected cron URL is shown in the module configuration:
https://yourshop.com/index.php?fc=module&module=dfmultiprice&controller=cron&token=YOUR_TOKEN
Add &id_rule=3 to recalculate a single rule. Schedule the URL with your host, for example every night: prices then follow exchange rate and cost changes and the end of promotions. The cron returns a JSON summary per rule and each run can be undone like a manual recalculation. If the token leaks, regenerate it in the configuration: the old URL stops working.
Auto-apply
When the option is enabled, creating or updating a product or a combination applies the active rules to that product. Useful for regular imports.
PrestaShop does not run a module’s hooks for an employee without the “View” permission on that module. Keep the cron as a safety net.
History
The module configuration lists the last 20 recalculations: date, rule, source (manual or cron), status, counters and number of changes recorded for undo.
Disabling, deleting and uninstalling
- Disabling or deleting a rule removes the prices it generated and gives their value back to manual prices it had taken over.
- Duplicating a rule creates a disabled copy, ready to adapt to another market.
- Uninstalling removes all generated prices and gives their value back to manual prices taken over.
Troubleshooting
A product is not updated
Check that it is active on the rule shop, belongs to the targeted category and brand and is not excluded. Run a simulation: the status tells whether it is on promotion or has no base price. With the “Cost price” base, it needs a cost price.
The displayed price does not have the right ending
Check that “Round the tax-included price” is enabled and that the rule country matches the customer’s. For a combination with an impact, enable “Price each combination”. In a currency other than the rule currency, PrestaShop converts the price: create a rule for that currency.
The price is right in euros but not in another currency
The rule is set to “All currencies”: the price is stored in the default currency and PrestaShop converts it, for example 23.90 EUR into 27.84 USD. The ending is not kept. The Check a price panel then shows the same specific price in both currencies. Create one rule per currency, with Country set to “All countries”, then recalculate.
A country rule does not apply to visitors
Visitors without an address are attached to the default country of the shop. A rule for another country only applies to customers with an address in that country, or to all visitors from that country when geolocation is enabled (International > Localization > Geolocation).
The ending is off in a single shop
In multistore, the rounding uses the VAT of the default country of the shop targeted by the rule. An “All shops” rule is based on the default shop: if your shops do not share the same default country, create one rule per shop.
The ending does not show on the tax-excluded price visitors see
If the Visitor group displays prices tax excluded, disable “Round the tax-included price”: the ending then applies to the tax-excluded price visitors see.
The summary shows conflicts
Another rule with the same shop, country, currency and group already holds these prices. Adjust the priorities or merge the two rules.
The Undo button does not appear
Only the latest recalculation of each rule can be undone, provided it was made with 1.1.1 and is among the last 5. A recalculation running for less than one hour cannot be undone yet.
The cron returns “Invalid token”
The URL token no longer matches the stored one. Get the up-to-date URL from the configuration.
A “-0.00” discount badge appears on some products
This is not a theme issue. PrestaShop 8.1 and later computes the displayed discount by subtracting the price rounded to 2 decimals from the price without reduction, kept at 6 decimals. As a rule price is stored tax excluded, adding the VAT back sometimes leaves a 0.000001 gap with 19, 21 or 23% VAT, which the theme shows as a -0.00 discount. Since version 1.1.4 the module cancels this gap on its own prices: update the module, then clear the cache in Advanced Parameters > Performance. No recalculation is needed.