ECM-3Required
Show the unit price beside the selling price
For goods sold to EU consumers by weight, volume, length or area, show the price per kilogram, litre, metre or square metre. Put it next to the selling price on product pages, lists and adverts.
How to do it
The Price Indication Directive 98/6/EC requires both the selling price and the unit price for products offered to consumers. Article 3(4) adds the unit price to any advert that names a selling price. Goods sold in bulk show only the unit price. The unit price may be left out when it equals the selling price. Member States may waive it for products where it is not useful, so check the national list. Store the net quantity and its unit on each variant, and compute the unit price on the server from the same price the cart uses. Show the total price with every fee as Show the total price with every mandatory fee says.
Examples
TypeScript example
const UNIT_BASE = { g: { per: 'kg', factor: 1000 }, ml: { per: 'l', factor: 1000 }, cm: { per: 'm', factor: 100 } } as const;
export function unitPriceMinor(priceMinor: number, quantity: number, unit: keyof typeof UNIT_BASE) {
const { per, factor } = UNIT_BASE[unit];
return { amountMinor: Math.round((priceMinor * factor) / quantity), per };
}
unitPriceMinor(349, 250, 'g'); // { amountMinor: 1396, per: 'kg' }, shown as "13.96 EUR/kg"
Python example
UNIT_BASE = {"g": ("kg", 1000), "ml": ("l", 1000), "cm": ("m", 100)}
def unit_price_minor(price_minor: int, quantity: float, unit: str) -> tuple[int, str]:
per, factor = UNIT_BASE[unit]
return round(price_minor * factor / quantity), per
How to check
A test lists every variant sold by weight, volume, length or area. Each has a net quantity, and its product page, list tile and feed entry show a unit price that equals price divided by quantity.
Sources
Related rules
- PAY-58 Show the total price with every mandatory fee in Payments and billing
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ecommerce/catalog-and-prices/unit-price">Agent Wranglers e-commerce and fulfilment playbook</a>. In code you write, add a comment next to it with the same link.