Everything you'd want to know before you install.
A detailed look at how Expiry Date & Batch Manager — Lots, FEFO and Use-By Dates works, why we built it the way we did, and the thinking behind the features above.
Use-by and best-before: two dates, two very different rules
A use-by date, known in France as DLC, applies to microbiologically perishable goods. Past that date the product is considered unsafe and must no longer be sold. A best-before date, known as DLUO or DDM, signals a loss of quality rather than a safety risk: the product remains legally sellable afterwards, provided the customer is clearly informed. That distinction is not cosmetic, it changes what a merchant is allowed to do. This is why the module treats the date type as a first-class field rather than a label.
Why PrestaShop stock is not enough
PrestaShop stores one quantity per product and combination. That quantity is a number with no memory of what makes it up. If you received thirty units in March and twenty in June, PrestaShop shows fifty, with no idea which ones should ship first or which ones are about to expire. Merchants end up keeping a spreadsheet on the side, discover unsold stock too late, and either discount in a panic or throw it away. The module replaces that spreadsheet with integrated management aligned on the real stock of the shop.
FEFO, applied automatically on every order
FEFO stands for First Expired, First Out: the batch with the closest date goes out first. When an order is validated, the module walks through the batches of the ordered product, prioritises those attached to the exact combination then those attached to the product, and deducts the quantity from the closest date upwards. A single order can therefore finish one batch and start the next, which is exactly what happens in the picking area. Every deduction is written to a movement history along with the originating order, giving you traceability that holds up during a product recall.
Sell before you lose: the automatic discount
A short-dated product loses value every day. Instead of monitoring it by hand, set a threshold and a percentage: when a batch enters the window, the module creates a catalog price rule on the product with an end date matching the expiry date exactly. The discount applies automatically, shows on the product page next to the short-dated badge, and disappears on its own without leaving an orphan rule in your catalog. Only one discount is active per product at any given time, to avoid unintended stacking.
What happens once the date has passed
Expired batch handling comes in three modes. The first simply deactivates the batch without touching stock, useful if you prefer to decide case by case. The second removes the remaining quantity from PrestaShop stock, immediately aligning the shop with the reality of the warehouse. The third goes further and disables the product when no valid batch remains, preventing the sale of an item whose entire stock has expired. Importantly, these stock actions apply to use-by batches only. An expired best-before batch is merely deactivated, since the product remains legally sellable.
Clear information for the customer
On the product page the module displays the date of the closest available batch, worded to match the date type: use by for a use-by date, best before for a best-before date. Below a threshold you define, a short-dated badge appears along with the discount percentage when one is active. Customers know exactly what they are buying, which cuts complaints and makes discounted short-dated stock safe to sell. All wording goes through the PrestaShop translation system and adapts to your theme.
One daily call, full automation
Discounts, expired batch handling and email alerts are driven by a token-protected cron controller, called once a day from your task scheduler or an external service. The response is a detailed JSON report listing how many discounts were created, batches deactivated, units removed from stock, products disabled and alerts sent. That output plugs straight into a monitoring tool, so automation never runs blind.
Who this module is for
Online delicatessens and greengrocers, coffee roasters, wine and beer merchants, food supplements, cosmetics and perfumery, veterinary products, raw materials and technical consumables: any catalog where the date matters as much as the reference. It is particularly relevant for shops receiving regular replenishments and ending up with several generations of stock for the same reference.
Technical design
The module builds on standard PrestaShop ObjectModels and admin controllers, with no Composer and no external dependency. JavaScript is written in vanilla, without jQuery. Data lives in two tables indexed on product and date, keeping the front-office display light even on a large catalog. The code is commented, readable and ready to be audited or extended.
There are no reviews yet.