Northlight

How to stop discount codes working on sale items in Shopify

Guide by Northlight Apps · Updated 4 November 2026

Short answer: Shopify discount codes have no "exclude sale items" switch. The free fix is an automated collection of products without a compare-at price, and a code that only applies to that collection. It works well — except for products where only some variants are on sale. Those can slip through. Check them before Black Friday (27–30 November).

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

  1. Go to Products → Collections → Create collection.
  2. Choose Automated (smart) collection.
  3. Add the condition Compare-at price is empty.
  4. 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

  1. Open each discount code (Discounts).
  2. Under Applies to, choose Specific collections and pick "Full price — for codes".
  3. 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.

ProductIn "full price" collection?Can a code stack on sale price?
No variants on saleYesNo sale price to stack on
All variants on saleNoNo — protected
Some variants on saleYesYes, possibly — check it

Ways around it:

Other things that quietly break it

A 2-minute test before Black Friday

  1. Open your store in a private window.
  2. Add one full-price item and one sale item to the cart — and, if you have one, the sale variant of a mixed product.
  3. Go to checkout and enter the code.
  4. 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.