---
title: "Show the lowest earlier price beside a · Agent Wranglers"
url: https://agentwranglers.se/playbook/payments/checkout-and-card-data/price-reduction-prior-price
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Show the lowest earlier price beside a discount

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Checkout and card data](https://agentwranglers.se/playbook/payments/checkout-and-card-data.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Recommended
- Chapter: [Checkout and card data](https://agentwranglers.se/playbook/payments/checkout-and-card-data)
- Rule: When you announce a price cut on goods to EU consumers, show as prior price the lowest price of the 30 days before.
- Applies when: The project takes payments, or has users in the EU.
- How: Article 6a of the Price Indication Directive, added by the Omnibus Directive 2019/2161, sets this rule. A struck-through list price that nobody paid breaks it. Member states may set other periods for goods that spoil fast or are new on the market. Keep a history of every price with its start and end time, so the prior price comes from data. Compute it on the server when the discount starts, and store it with the discount. Log every price change as [Log every staff action on money](https://agentwranglers.se/playbook/payments/invoices-and-records/money-audit-log) says.
- Check: A unit test sets a price of 200, then 150 for 10 days, then 200 again, then a sale at 120. The page shows 150 as the prior price.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### SQL example

```sql
SELECT min(amount_minor) AS prior_price_minor
FROM price_history
WHERE product_id = $1
  AND valid_from < $2
  AND coalesce(valid_to, $2) > $2 - interval '30 days';
```

### JavaScript example

```js
const PRIOR_PRICE_WINDOW_MS = 30 * 24 * 60 * 60 * 1000

function priorPrice(history, saleStartsAt) {
  const windowStart = saleStartsAt - PRIOR_PRICE_WINDOW_MS
  const inWindow = history.filter(p => p.validFrom < saleStartsAt && (p.validTo ?? saleStartsAt) > windowStart)
  return Math.min(...inWindow.map(p => p.amountMinor))
}
```

### Python example

```python
from datetime import timedelta

PRIOR_PRICE_WINDOW = timedelta(days=30)

def prior_price(history, sale_starts_at):
    window_start = sale_starts_at - PRIOR_PRICE_WINDOW
    return min(p.amount_minor for p in history
               if p.valid_from < sale_starts_at and (p.valid_to or sale_starts_at) > window_start)
```

## Sources

- [Directive (EU) 2019/2161, Article 2 adding Article 6a](https://eur-lex.europa.eu/eli/dir/2019/2161/oj)

## Related rules

- [Log every staff action on money](https://agentwranglers.se/playbook/payments/invoices-and-records/money-audit-log) in Payments

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/payments/checkout-and-card-data/price-reduction-prior-price">Agent Wranglers payments playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Confirm your PCI DSS compliance every year](https://agentwranglers.se/playbook/payments/checkout-and-card-data/pci-annual-attestation)
- [Checkout and card data](https://agentwranglers.se/playbook/payments/checkout-and-card-data)
