Guides / How to exclude sale items from a discount code in Shopify

How to exclude sale items from a discount code in Shopify

Your sale is live, and your welcome code still takes money off the marked-down items too. Here is how to keep codes off sale items, the two catches to check before you rely on the fix, and another option for stores that show an MRP.

The short answer

Shopify's discount settings have no "exclude sale items" box. The free fix is a collection of the products that are not on sale, and a code that applies only to that collection.

  1. Go to Products, then Collections, and click Create collection.
  2. Choose Automated and add the condition Compare-at price is not set.
  3. Save. Shopify fills the collection with products that have no compare-at price and keeps it updated as you edit products.
  4. Open your code under Discounts. In Applies to, choose Specific collections and pick the new collection.

When you put a product on sale later and give every variant a compare-at price, it leaves the collection, and the code stops working on it without another edit.

Why a code stacks on a sale price

Shopify takes a code's percentage off the price an item sells at. When you mark something down, the lower number goes into Price and the old one moves to Compare-at price. To Shopify the sale price is simply the price, so a 15% welcome code takes 15% off it.

Combination settings won't stop this. They decide how one discount mixes with another, and a compare-at markdown isn't a discount at all.

Two catches before you rely on it

Variants. The rule looks at each variant. A product joins the collection if any one of its variants has no compare-at price. So if only the blue shirt is on sale and the red one is at full price, the whole product is in, and the code works on the blue one as well. For those products, put every variant on sale, or keep the product out with a tag (below).

Stores that always show an MRP. Many Indian stores fill Compare-at price with the MRP on every product, on sale or not. For them the collection comes out empty, since no product has a blank compare-at price. Use a tag instead.

The tag way

  1. Add a tag such as on-sale to every product in the sale. The bulk editor or a CSV import does this quickly.
  2. Create an automated collection with the condition Tag does not include on-sale.
  3. Point your code at that collection, as in step 4 above.

Shopify won't remove the tag for you. Take it off when the sale ends, or those products stay out of every code.

Codes you already have

Making the collection doesn't change any existing discount. Open each live code and automatic discount under Discounts and set Applies to the new collection. Welcome codes, WhatsApp codes and creator codes are easy to miss, so list them before you start.

Then test it. Put one sale item and one full-price item in a cart, apply the code, and check that only the full-price item gets money off.

What the shopper sees

In a mixed cart the code applies, and the sale item just keeps its price. If the cart holds only sale items, Shopify won't apply the code, and its message doesn't say why. A shopper may well think the code is broken. Add "Not valid on sale items" wherever you share the code to save yourself those support chats. If a code fails for another reason, go through the eight checks for a discount code.

The MRP way: let the code work it out

Keeping codes off sale items means a shopper with your code gets nothing on the sale item they came for. Some stores would rather work the code out from the MRP. Say a product's MRP is Rs 1,000 and you announce "Flat 40% off", so the shopper expects to pay Rs 600.

  • At full price, Rs 1,000, the code takes Rs 400 off and the shopper pays Rs 600.
  • On sale at Rs 800, a normal code takes 40% of Rs 800, so the shopper pays Rs 480. That is 52% below your MRP. Worked out from the MRP, the code takes Rs 200 off and the shopper pays Rs 600.
  • On sale at Rs 500, the sale is already deeper than the offer. The code takes nothing off and the shopper pays Rs 500.

Nobody gets more than the offer you announced, and you don't need a separate collection. We make the MRP Discount app to work this way. You create the code in the app, pick the products or collections, and it shows on Shopify's Discounts page with your other codes. MRP vs sale price explains the maths in more detail.

Quick checklist

  1. Decide whether to block codes on sale items or work them out from the MRP.
  2. Check if your store fills Compare-at price on every product. If it does, use a tag.
  3. Build the collection, then open a few products in it, including one with many variants.
  4. Point every live code and automatic discount at it.
  5. On your phone, test one mixed cart and one cart with only sale items.
  6. Write "Not valid on sale items" wherever the code appears.

Quick answers

Can I exclude sale items from a discount code in Shopify?

Not with a single setting. Create an automated collection with the condition Compare-at price is not set, then limit the code to that collection under Applies to.

Why does my discount code apply to items already on sale?

Shopify treats the sale price as the item's price and takes the code's percentage off it. Combination settings don't change this, because a compare-at markdown is not a discount.

Why do some sale items still get the code?

A product joins the collection if any one of its variants has no compare-at price. Put every variant on sale, or keep the product out with a tag.

What if every product shows an MRP in Compare-at price?

Then the compare-at rule finds no products. Tag your sale items and build the collection with the condition Tag does not include that tag.

What does the shopper see when the code doesn't apply?

With a mixed cart, the sale item keeps its price and the rest gets the discount. With only sale items, Shopify won't apply the code and doesn't give a reason, so say "Not valid on sale items" wherever you share it.

More guides

Run your next sale on the MRP.

Install it, make one code, and check it in your own checkout. The first 7 days are free.