PrestaShop Catalogue Management

Expiry Date & Batch Manager — Lots, FEFO and Use-By Dates

One batch, one date, an honest stock deduction: use-by and best-before dates finally handled inside PrestaShop.

PrestaShop only knows one quantity per product. If you sell food, cosmetics, supplements, veterinary products or any dated item, that number tells you nothing about what should ship first or what is about to expire. This module adds real batch management: every lot carries its number, its date type (use-by or best-before), its expiry date and its quantity. On every order, stock is deducted from the batch closest to its date (FEFO). Ahead of the deadline a discount kicks in automatically; on the deadline, the batch leaves the sales circuit. Compatible with PrestaShop 8 and 9.

At a glance
  • Batch-level management: lot number, use-by or best-before date type, expiry date, quantity, supplier reference
  • Automatic FEFO deduction on every order: the batch closest to its date ships first
  • Automatic short-date discount, with a price rule that switches itself off on the expiry date
  • Automatic handling of expired batches: deactivate, remove from stock, or disable the product
  • The legal use-by / best-before distinction is respected: stock actions apply to use-by batches only
PrestaShop 8 & 9 FEFO Use-by / Best-before Food & cosmetics
  • 30-day refund
  • 12 months updates
  • 24h support
www.datafirefly.com/en/
Expiry date management by batch with FEFO picking in PrestaShop
v1.0.0 · updated 2026-07-22
What it does

The short version.

01

Managed by batch, not by product

Every lot carries its number, date type, expiry date, quantity and supplier reference. A single product can hold as many batches as needed, at product level or on a specific combination.

02

Automatic FEFO deduction

First Expired, First Out: when an order is validated, the quantity is deducted batch by batch starting with the closest date. Every movement is logged along with the originating order.

03

Automatic short-date discounts

When a batch approaches its expiry date, a percentage catalog price rule is created automatically, ending exactly on the expiry date. The discount switches itself off, with no manual cleanup.

04

Expired batches handled for you

On the expiry date the batch is deactivated. Depending on the chosen mode, its remaining quantity is removed from PrestaShop stock and the product can be disabled when no valid batch is left.

The long version

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.

§ 01

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.

§ 02

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.

§ 03

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.

§ 04

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.

§ 05

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.

§ 06

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.

§ 07

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.

§ 08

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.

§ 09

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.