Four rules decide what is recorded and what a shopper reads.
Rule 1: written when the price changes
Many plugins reconstruct a "lowest price" from WooCommerce's sale-price field at the moment the page is drawn. That is how they come to display a price the shop never offered.
This plugin keeps a record instead:
- Every time WooCommerce works out a product's price for a shopper, the plugin looks at the result.
- If it differs from the last price recorded for that product (and variation, and currency), a row is written: product, variation, price, currency and the time.
- If it is the same, nothing is written. A shop listing of forty unchanged products costs forty quick lookups and no writes.
Rows are never updated, only added. Each currency has its own history, so a multi-currency shop never compares euros with pounds.
Rule 2: a price nobody saw is not a price
A price typed, saved and corrected two minutes later never reached a shopper. So nothing is recorded:
- in wp-admin;
- under WordPress cron;
- through the REST API;
- for a product that is not published (drafts, private, pending).
The history is exactly the set of prices a shopper could have been shown on your storefront.
Rule 3: the reference is always shown
When a product is reduced — on sale, or priced below its regular price by another plugin — the line is printed. If nothing has been recorded for it yet, the regular price is shown as the reference rather than nothing. A struck-through price with no lowest-price line beside it is the thing to avoid, so the safe direction is always to show one.
Full edition: the compliance report lists the products currently using the regular-price fallback.
Rule 4: every dynamic price counts
A Discount Rules percentage, a Wholesale Pricing rate and a Customer Catalogs price are all reductions a shopper sees. Those plugins set their price through WooCommerce's woocommerce_product_get_price filter. Price History reads that same filter at priority 999 — after everyone else — so the price it writes down is the price WooCommerce finally handed out. A plugin that watches only the sale-price field misses every one of them.
The window
The window does not count back from today. It counts back from the moment the current price began:
- Find when the current price was first recorded — the start of the current run.
- Go back 30 days from there (Full edition: the number of days for the shopper's country).
- The reference is the lowest of:
- every price recorded inside that window, and
- the price that was already in force when the window opened.
- The current price itself is not part of its own reference.
So a sale that has run for three weeks is still measured against the thirty days before it started.
Worked example
| Date | Price shown | Recorded |
|---|---|---|
| 1 March | €30 | yes |
| 10 March | €27 (a discount rule) | yes |
| 20 March | €30 | yes |
| 1 April | €24 (sale starts) | yes |
On 15 April the shopper sees €24. The window runs from 2 March to 1 April. Prices in it: €27 and €30, plus €30 in force on 2 March. The line reads Lowest price in the last 30 days: €27.00.
Variable products
A variable product shows a price range whose low end is its cheapest variation. It therefore owes that variation's reference, and the line on the range is the cheapest purchasable variation's (up to the first 50 variations are compared). Each variation has its own history; when a shopper chooses one, the variation form shows that variation's line.
Exemptions — Full edition
- Introductory price: no line at all.
- Progressive reduction: the window is anchored at the first cut, so a second and third cut are measured against the price before the series began, not against each other.
- Exempt category: no line for any product in it.
The free edition applies none of these.
Pruning
Once a day the plugin removes rows older than the longest window plus 60 days — but never the latest row of a product, which is the price in force however old it is. Deleting a product for good removes its history; moving it to the bin keeps it, so a restored product keeps its reference.
What it never does
It never changes a price, never touches an order, and never calls an external service. It records and prints.
