Skip to content

Block discount codes during a sale

To keep discount codes from stacking on top of sale prices, restrict the codes to products that aren’t on sale. Shopify doesn’t have a direct “exclude sale items” switch, but an automated collection gets you the same result.

1. Create a collection of non-sale products

Section titled “1. Create a collection of non-sale products”
  1. In your Shopify admin, go to Products > Collections and click Create collection.
  2. Select Automated as the collection type.
  3. Add the condition Compare at price is empty.
  4. Name it something like Eligible for discount codes and save.
An automated collection with the Compare at price is empty condition

Products on sale have a compare at price set (that’s what shows the crossed-out original), so this collection holds exactly the products that aren’t discounted. When a sale starts or ends, Shopify updates the collection on its own.

  1. Open the discount code in your Shopify admin.
  2. Under Applies to, select Specific collections and pick Eligible for discount codes.
  3. Save the discount.
A discount code with Applies to set to the Eligible for discount codes collection

The code now works on full-price products only.