Sold-out products in a Shopify sale: what SafeSale does
SafeSale ignores inventory. What a price rewrite or automatic discount does to sold-out variants, what a mid-sale restock gets, and how to exclude them.
By Beacon Wave Studio · · 7 min read
Every sale we see has sold-out items in it somewhere. A colour that went in September, a size that never came back, a product that is still published because the supplier promised a restock. Merchants ask us two opposite things about them: "why is my sold-out hoodie showing a sale badge" and "why did the restock come back at full price". Both have the same root: SafeSale does not know what is in stock, on purpose, and what happens to a sold-out variant depends entirely on which of the two mechanisms the sale uses.
SafeSale never reads inventory
When you pick what goes on sale, you pick products, collections, tags and vendors. SafeSale turns that into one Shopify product search (every selection is OR-ed together) with a single built-in exclusion: gift cards. There is no inventory clause, no "available for sale" check, and the app does not request the inventory scope at all. You can confirm that on the permissions screen when you install it: products, discounts, pixels, and that is the list.
This is deliberate. Inventory changes every minute during a sale, and a pricing tool that re-decides who is on sale based on a quantity would be the most confusing thing in your admin. The sale lifecycle is a fixed set of steps for a fixed set of variants, and stock is left to Shopify, where it already lives.
Price rewrite: sold-out variants are rewritten too
A price rewrite sale walks the matching products when it applies, snapshots each variant's price and compare-at price, writes the sale price and moves the old price into compare-at. A variant with zero stock gets the same treatment. The consequences, in the order merchants notice them:
- The sold-out product shows a sale badge. Most themes show "Sale" whenever compare-at is above price, and a "Sold out" badge whenever the variant is unavailable. Many show both. SafeSale's own badge embed follows the same rule, because the storefront cannot see a difference between a sold-out variant on sale and one with stock.
- A restock lands at the sale price. If stock arrives mid-sale for a variant that was rewritten, it is already priced for the sale. No step needed. This is the behaviour most merchants want and the reason we do not skip empty variants.
- Google and the agents see a discounted, unavailable item. Your Merchant Center feed carries both the sale price and an out-of-stock availability. That is valid and common; it is just not a product that will sell today.
- Restore does not care about stock either. When the sale ends, SafeSale writes the snapshot back to every variant it touched, whether it sold out, restocked or never moved. If a variant was deleted in between, the deleted-during-sale post covers what you see.
One thing that does not happen: a restock does not trigger anything in SafeSale. The app listens to Shopify's product update webhook only to detect prices that drift while a variant is on sale. It compares the live price and compare-at against what it applied, and if they match, as they will after a pure inventory change, the webhook is ignored.
Automatic discount: sold-out variants are eligible, not priced
The other mechanism creates one automatic discount whose configuration carries your selection: product IDs, collection IDs, tags, vendors, the rule, the per-variant overrides and the hard cap. Nothing is written to any variant. Shopify runs the discount against each cart and takes the amount off eligible lines.
A sold-out variant cannot be added to a cart, so for practical purposes it is not on sale, even though it is eligible on paper. The visible differences from a rewrite:
- The product page shows the regular price and no strikethrough, because price and compare-at are unchanged. Themes that cannot read automatic discounts show no sale badge; SafeSale's store-wide badge embed shows one based on the active sale, not on the price.
- A restock becomes discountable the moment stock is positive, with no action from you, because eligibility is decided when the cart is priced.
- If your selection is an in-stock collection, membership is evaluated live. A product that sells out leaves the collection and stops qualifying; one that restocks joins and starts qualifying. With a rewrite, membership only matters at the moment of applying.
If the strikethrough on the product page matters to you for sold-out items (for example a clearance where "was 80, now 50, gone" is part of the story), you want the rewrite. If you want sold-out items to look untouched until they come back, you want the discount.
Three ways to exclude sold-out products on purpose
- Target an in-stock automated collection. In Shopify, create a collection with the conditions you already use for the sale plus "Inventory stock is greater than 0", and select that collection in SafeSale. For a rewrite, items that are sold out when the sale applies are left alone, and items that restock later stay at full price (the rewrite ran once; see the FAQ). For a discount, the collection is checked per cart, so it tracks stock for the whole sale.
- Tag what you want in. A tag such as
bf-2026applied with Shopify's bulk editor to the in-stock products you reviewed is the most predictable selection: nothing moves in or out unless you edit a tag. It is also the easiest to explain to staff. - Unpublish instead of excluding. If a sold-out product is not coming back, set it to draft or unpublish it from the Online Store channel before the sale. It will still be rewritten if it matches the selection (SafeSale does not filter on status either), but shoppers, Google and agents will not see it, and the restore at the end puts the price back regardless.
The preview is where you catch it
Before a sale applies, SafeSale lists every variant it is about to change with the before and after prices. That list does not show stock, but the variant titles do, and a quick scan for the sizes and colours you know are gone is enough to decide whether to narrow the selection first. The snapshot CSV you can download afterwards has the same variants, so if a "why is this on sale" question comes up mid-sale, the answer is one search away.
The rule to remember: SafeSale puts prices on the variants you selected and takes them off again at the end. Whether those variants can be bought in between is Shopify's business, and the clean way to keep sold-out items out of a sale is to keep them out of the selection.
Frequently asked questions
Does SafeSale skip sold-out products when it applies a sale?
No. SafeSale selects products by product, collection, tag and vendor, and it never asks Shopify for inventory. A sold-out variant that matches your selection is treated exactly like one with stock: a price rewrite changes its price and compare-at price, an automatic discount lists it as eligible. The only thing SafeSale excludes on its own is gift cards.
How do I keep out-of-stock items out of a SafeSale sale?
Target an automated collection whose conditions include Inventory stock is greater than 0, or tag in-stock products and target the tag. Shopify keeps the collection current; SafeSale reads it when the sale applies (price rewrite) or when a cart is priced (automatic discount). Alternatively, put the sold-out products in a collection you do not select at all.
A product sold out during the sale. Does the sale price come off?
Not with a price rewrite. The variant was rewritten when the sale started and it stays at the sale price until the sale ends, when SafeSale restores the original from its snapshot. With an automatic discount nothing is stored on the variant, so the question does not arise: the discount only ever applies to lines in a cart, and a sold-out variant cannot be added to one.
I restocked a product halfway through the sale. Is it on sale?
If it matched the selection when the sale applied, yes: a price rewrite has already set its price, and an automatic discount evaluates each cart against the selection. If it only joined the selection after the sale applied (for example it entered an in-stock collection on restock), a price rewrite will not pick it up, because the rewrite ran once. An automatic discount will, because it checks membership per cart.