The module records the price history of every product and shows, on the product page, the lowest price from the thirty days before a reduction — the information required by the Omnibus Directive. This page covers installation, every configuration option and the problems people run into.

What the module does

Whenever a product price changes, the module appends a row to its own table ps_omnibus_prices. Four PrestaShop events trigger the write: saving a product (actionProductUpdate) and adding, changing or deleting a specific price (actionObjectSpecificPriceAddAfter, …UpdateAfter, …DeleteAfter). On the front office the module hooks into displayProductPriceBlock and prints a line with the lowest price of the last thirty days below the price, optionally with a history chart.

In the back office it adds a tab to the product page (displayAdminProductsExtra) showing the stored history, where a single entry can be corrected by hand.

Requirements

  • PrestaShop 1.6, 1.7, 8 or 9.
  • No extra PHP extensions, no ionCube.
  • A theme that renders the displayProductPriceBlock hook on the product page — every classic-based and hummingbird-based theme does.

Installation

  1. Back office → Modules → Module Manager → Upload a module, select the ZIP file.
  2. The installer creates the ps_omnibus_prices table and registers seven hooks by itself.
  3. Open the module configuration and save it once — saving writes the default caption for every language.

History starts on the day you install. The module cannot know prices from before the installation, because PrestaShop does not store them anywhere. For the first thirty days the caption therefore works on incomplete data — that is normal and true of every module of this kind.

Configuration

Option Key What it does
Caption under the price omnibusprices_title_<id_lang> The text before the amount, set per language. Defaults to “Lowest price in the last 30 days from promotion:”.
Show prices without tax omnibusprices_tax Switches the caption to net amounts. Useful in B2B shops.
Do not store promotion prices omnibusprices_promotions Only base prices enter the history. Turn it on if you do not want each promotion to lower the reference point.
Do not store combination prices omnibusprices_combinations History is kept per product rather than per variant. Cuts table growth sharply in catalogues with many combinations.
Do not store every price change omnibusprices_every Limits writes to one entry per day instead of one per product save.
Chart on the product page omnibusprices_chart Adds a thirty-day price history chart below the price.
Product page only omnibusprices_product Hides the caption on listings and search results, keeping it on the product page only.

Cron jobs

The module ships three URL-driven controllers, all protected by a token:

  • cron — writes the daily price entry for the whole catalogue. Worth scheduling once a day if you change prices through an import that bypasses PrestaShop hooks.
  • clean — removes entries older than the thirty-day window needs.
  • export — returns the history of one product; used by the back-office tab.

A fourth controller, showprice, recalculates the caption over AJAX when the visitor switches a combination on the product page.

Troubleshooting

The caption does not appear under the price

Check under Design → Positions that the module is attached to displayProductPriceBlock. Themes that override catalog/_partials/product-prices.tpl and drop the hook call from it leave the module nowhere to print — add {hook h='displayProductPriceBlock' type='after_price'} back into the template.

The caption shows the same amount as the promotional price

That means the history has no pre-promotion price yet — either the module was installed after the promotion started, or “do not store promotion prices” is on and the product has had no base price since installation.

Amounts differ by a few cents

The module rounds the caption to the currency precision of the shop. With a currency set to zero decimal places the amount is rounded and may differ from a price calculated to the cent. Precision is set under International → Currencies.

The history table has grown very large

Turn on “do not store combination prices” and “do not store every price change”, then run the clean controller. In a catalogue with many variants and a daily price import those two options cut table growth by an order of magnitude.

What uninstalling does

Uninstalling drops ps_omnibus_prices together with the whole price history. If you plan to reinstall, back the table up first — once the history is gone it cannot be reconstructed.

Module page in the shop

Chargement...
Retour en haut