A sale that will not stop
The sale's end date passed, but the sale never ended. Customers still pay the sale price, or see it in lists and filters and pay more at checkout.
The symptom
You set a sale to run for two weeks in March. It is September, and the sale never ended. What that looks like depends on your WooCommerce version and on the product.
On WooCommerce older than 11.1, a simple product shows the sale price as its normal price and the cart charges it. There is no sale badge and no crossed-out regular price, because WooCommerce checks the dates before it shows those. Nobody complains: from the customer’s side it is simply a good price.
From 11.1, the product page and the cart work out the right price from the dates, so the customer pays the regular price. The price filter, sorting by price and “on sale” product lists still use the sale price, though. A product on sale at 70 instead of 100 turns up when a customer filters for prices up to 80, and in your “On sale” block, and then costs 100.
A variation behaves like that on every version: the cart charges the regular price, while the parent product keeps showing the crossed-out price and the sale badge, in the store and on its own page.
What it costs
On WooCommerce older than 11.1, a simple product has been selling at the sale price since the end date. The cost is units sold since the end date × the difference between the regular and sale price. It is arithmetic, not an estimate: take the units from WooCommerce → Analytics → Products for the days since the end date.
Everywhere else the cost is the gap between the price you show and the price you charge. A customer who filtered by price, or clicked the sale badge, meets a higher price in the cart.
The mechanism explains why this happens at all. WooCommerce keeps three values: _regular_price,
_sale_price and _price, the price in effect. The badge and the crossed-out price come from the
sale dates. The price in effect comes from _price, and a scheduled action rewrites it when a sale
starts and when it ends. Since WooCommerce 10.5 every sale with a date has its own actions,
wc_product_start_scheduled_sale and wc_product_end_scheduled_sale, and the daily
woocommerce_scheduled_sales event catches what they missed. Before 10.5 the daily event did all of
it. From 11.1 WooCommerce also corrects the price on the product page and in the cart while it waits
for the action, which is why the symptom changed.
All of these actions run on the queue. If the queue has stopped, the sale never ends, and nothing tells you: no notice, no email, no entry in any log. See Background queue stopped running. On most stores the two findings show up together, and fixing the queue is the real repair.
How to check it yourself
The line that matters is the one comparing _price with _sale_price. Since WooCommerce 10.5 a
sale that ended properly keeps its sale price and dates in the product, and only _price goes back
to the regular price. Without that line the query lists every sale you have ever run.
wp db query "SELECT p.ID, p.post_type, p.post_title,
FROM_UNIXTIME(dt.meta_value) AS ended,
rp.meta_value AS regular, sp.meta_value AS sale, pr.meta_value AS in_effect
FROM wp_posts p
JOIN wp_postmeta dt ON dt.post_id = p.ID AND dt.meta_key = '_sale_price_dates_to'
JOIN wp_postmeta rp ON rp.post_id = p.ID AND rp.meta_key = '_regular_price'
JOIN wp_postmeta sp ON sp.post_id = p.ID AND sp.meta_key = '_sale_price'
JOIN wp_postmeta pr ON pr.post_id = p.ID AND pr.meta_key = '_price'
WHERE p.post_type IN ('product', 'product_variation')
AND p.post_status = 'publish'
AND sp.meta_value <> '' AND dt.meta_value <> ''
AND dt.meta_value < UNIX_TIMESTAMP() - 86400
AND rp.meta_value + 0 > sp.meta_value + 0
AND pr.meta_value + 0 = sp.meta_value + 0"
Replace wp_ with your table prefix. Variations keep their own copies of these fields, which is why
the query includes them: a parent that looks fine can still have one variation stuck on last
spring’s price. The - 86400 skips sales that ended less than a day ago, for the reason given in
the last section.
After a planned sale, Black Friday for example. The day after the end date, open WooCommerce →
Status → Scheduled Actions, the Past-due tab, and search for wc_product_end_scheduled_sale. An
action still waiting there is a sale that has not ended yet. Then run the query above.
How to fix it
-
Fix the queue. This is the real repair: once it runs, the overdue actions end the sales and the prices go back to what you set. If it stays broken, this happens again with the next sale.
-
To end the overdue sales right away, run the daily event by hand:
wp eval 'wc_scheduled_sales();'Without WP-CLI: WooCommerce → Status → Scheduled Actions, search for
woocommerce_scheduled_salesand choose Run. It ends every sale whose end date has passed, products and variations alike, sets_priceback to the regular price and refreshes the product’s lookup row. Since WooCommerce 10.5 it leaves the sale price and dates in the product; older versions clear them. -
Then look at the orders from the gap. On WooCommerce older than 11.1 they were charged the sale price. Nothing forces a decision here, but it is worth knowing the number before it turns up in a margin report.
Editing _price directly in the database is the one thing not to do. WooCommerce keeps derived
copies in its lookup tables, and a hand-edited row makes the catalog and the reports disagree.
When it’s a false alarm
- You extended the promotion on purpose and never updated the end date. It still needs a fix: as soon as the queue runs again, WooCommerce ends the sale at the old date. Set the new end date, or remove it for a sale with no end.
- The sale price is not lower than the regular price. Some importers write both fields the same. There is no discount to lose, and WooCommerce does not treat it as a sale. Merchlint skips these.
- A price plugin overrides everything: dynamic pricing, role-based pricing, wholesale rules. Those set the final price at runtime, so the stored fields say little. If you run one, treat this finding as a prompt to check, not as a verdict.
How Merchlint finds it
Merchlint reads _sale_price_dates_to, _regular_price, _sale_price and _price for every
published product and variation. It reports the item only when the end date is more than a day in
the past, the sale price is lower than the regular one, and _price still equals _sale_price, so
the end of the sale never ran. Prices are compared as numbers: 70 and 70.00 match. The finding
shows both prices, the end date and the number of days since.
The day of grace is there because of how WooCommerce ends sales on variations. In WooCommerce 11.2
the action that ends a sale on a single variation leaves _price alone, and the daily event, at
midnight store time, is what updates it. For a few hours after the end date, even a correctly ended
sale can look stuck.
Confidence: F—fact from the database. Stored values compared against a stored date; nothing is inferred.
The finding does not show revenue: Merchlint checks every product here, not only the ones that sold. To put a number on it, use the calculation under “What it costs”.
Doesn't match what you see in your store? Email us—we read every message. contact@merchlint.com