How to stop discount codes working on sale items in Shopify
Why it happens
A discount code applies to whatever products you choose in Applies to. If you choose "All products", it also applies to items you already marked down with a compare-at price — so a shopper gets 30% off the sale price and then another 15% with a code. In Shopify there's no separate "sale item" setting; a product is "on sale" only because a compare-at price is filled in.
Step 1 — Make a "full price" collection
- Go to Products → Collections → Create collection.
- Choose Automated (smart) collection.
- Add the condition Compare-at price is empty.
- Save. Name it something like "Full price — for codes" and keep it off your menus if you don't want shoppers to see it.
Because it's automated, the collection updates on its own: when you add a compare-at price to a product, it leaves the collection; when you remove it after the sale, it comes back.
Step 2 — Point your codes at it
- Open each discount code (Discounts).
- Under Applies to, choose Specific collections and pick "Full price — for codes".
- Save, and repeat for every code that shouldn't work on sale items — including influencer and welcome codes.
The catch: products with some variants on sale
This is the part most guides skip. In Shopify's own documentation, the "compare-at price is not set" rule matches a product when at least one variant has no compare-at price. A classic collection holds whole products, not single variants.
So if your T-shirt has a black variant on sale (compare-at filled) and a white variant at full price, the whole T-shirt is in your "full price" collection — and the code can still apply to the black one that's already on sale.
| Product | In "full price" collection? | Can a code stack on sale price? |
|---|---|---|
| No variants on sale | Yes | No sale price to stack on |
| All variants on sale | No | No — protected |
| Some variants on sale | Yes | Yes, possibly — check it |
Ways around it:
- For the few mixed products, put the whole product on sale or none of it during the campaign.
- Or choose Specific products in the code and pick only the full-price variants (fine for a short list, hard to keep up to date for a big catalogue).
- Shopify's help pages say a new collections model is replacing classic collections, and it can include and exclude variants. If it's already in your admin, test whether a variant-based "full price" collection works with your codes before relying on it.
Other things that quietly break it
- Old compare-at prices left behind. A variant that still has a compare-at price after the sale ended counts as "on sale" and drops out of the collection, so codes stop working on it. Clear compare-at prices when the sale ends.
- Sales made with automatic discounts. If your sale is an automatic discount (not a compare-at price), the collection method doesn't see it. Use the Combinations setting instead: make sure your codes are not allowed to combine with that product discount, then test what checkout shows. (Automatic discounts have another common problem — they're often not shown on product pages at all.)
- New codes made later. Each code has its own "Applies to". A code created next month with "All products" will stack again. Add "check Applies to" to your checklist for every new code.
A 2-minute test before Black Friday
- Open your store in a private window.
- Add one full-price item and one sale item to the cart — and, if you have one, the sale variant of a mixed product.
- Go to checkout and enter the code.
- Look at each line: the discount should appear only on the full-price items.
If the sale item gets the code too, check that product's variants first (the catch above), then the code's "Applies to" and "Combinations" settings.
FAQ
Is there an app that does this?
Some discount apps can exclude sale items, but try the free collection method first — for most stores it's enough. If you do use an app, ask what happens to your codes and prices if you uninstall it.
Does this stop codes from leaking to coupon sites?
No — it only limits where a code works. A leaked code still works on full-price items. See how to stop discount code leaks.
Will shoppers see an error?
If the cart has only sale items, Shopify shows the shopper a message that the code can't be used on them. Mention "not valid on sale items" in your campaign so it isn't a surprise.