WooCommerce
WooCommerce Product Price History: How to Show the Lowest Price During a Sale

When you run a sale, you show the lowest price from the last 30 days next to the reduced price. Sounds simple. The catch is that to know that price, your store has to record the product’s price history, and WooCommerce doesn’t do that by default. This guide is about the practical side: what to display on the product page, how to handle variations and which types of sales to click through before a campaign goes live. We covered the legal requirements of the EU Omnibus Directive in our December 2022 post, so we won’t repeat them here.
Table of Contents
Why won’t WooCommerce show the lowest pre-sale price on its own?
Because WooCommerce only stores the current regular price and sale price. It has no idea what the product cost a week or a month ago. When you change a price, the old value is overwritten and leaves no trace and no date. Some stores get by with a spreadsheet and log prices by hand. With a dozen or so products that still sort of works. But with hundreds of items and frequent changes it turns into a mess, and mistakes are very easy to make. You need a mechanism that records every price change along with its date, automatically.
How product price history works in an online store
Product price history is simply a dated record of every price change, which the store uses to work out the lowest value in a given period. In my view, the best place for this data is a separate database table, not product metadata. The database stays tidy and the lowest-price query runs faster. You count the 30-day window back from the day the sale starts. And here’s the catch: recording has to start before the first price cut. Otherwise there’s nothing to compare the sale price with.
Where and how to show the discount notice on the product page
Put the lowest-price notice right next to the sale price, so the customer sees both values at once. A few rules that make life easier for them:
- Plain wording, e.g. „Lowest price in the 30 days before the discount: PLN 89”.
- Readability: text slightly smaller than the main price, but with clear contrast, not light grey on a white background.
- Only during a sale: a product at its regular price shows no notice.
The discount notice should look the same everywhere a struck-through price appears. On category listings, in product widgets, in search results. Everywhere. Don’t leave a struck-through regular price without context (a common mistake), because customers may take it for the pre-sale price, even though it isn’t.
WooCommerce sale prices and products with variations
For a variable product, you calculate the lowest price separately for each variation. Each one has its own price and its own history, so there’s no other way. Does the customer pick a size or a colour? The notice should change together with the price of the selected variation. Before they pick anything, it’s better to show a price range than a single value that applies to only part of the offer. Oh, and variations that aren’t on sale don’t get a notice, even if their sibling variations happen to be discounted.
Common sale scenarios worth testing
The most trouble comes from scheduled sales, price increases right before a discount and back-to-back price cuts. Before a campaign starts, go through this list step by step:
- A sale scheduled in WooCommerce: does the notice appear exactly on the start date, and not only after you save the product manually?
- Gradual price reductions: at each step, does the store compare against the correct period, and not against the price from the previous stage of the same campaign?
- Back to the regular price, then another sale: does the history take into account the lower price from the previous campaign?
- A new product: what does the product page show when the history is shorter than 30 days?
Finally, open the product page in a private window as a logged-out customer. Do the prices and the notice match what you see in the admin panel? If so, you can rest easy.
Showing the lowest 30-day price automatically with a plugin
In practice, the simplest option is to hand price recording and the lowest-price calculation to a plugin that does it on its own. That’s the job of the Price History for WooCommerce plugin from K4.pl. It stores data in an additional database table and analyses the price history by itself. It shows the lowest price from the last 30 days on product pages, but only when the product is on sale. Product pages at regular prices stay unchanged.
If product price history is running in your store before the first sale starts, you won’t calculate anything by hand or fix product pages during later campaigns. You set the sale price, and the notice appears next to it automatically. That’s it.
Frequently asked questions
Does WooCommerce have built-in price history?
No. WooCommerce only stores the current regular price and sale price, and simply overwrites previous values. Want to track price changes over time? You need an extension or your own code that records every change with its date.
When does the 30-day period for the lowest pre-sale price start?
Count back from the day you introduce the discount. The prices in effect during that period determine the value you show the customer. We described the legal details, including exceptions, in our December 2022 post.
Does the notice have to appear on products that are not on sale?
No. The requirement applies to announced price reductions, so a product at its regular price doesn’t need the notice. In fact, extra information in that spot is more likely to confuse the customer than help them.