How To Create A Discount Code Excluding Sale Items In Shopify

Feb 12, 2024

Do you want to create a discount code for your customers, but only have it apply to full priced products?

Maybe you have markdowns or sale products, but don't want your 10% off sign up code applying further discounts to those products?

Shopify doesn't have an easy checkbox option for this, but there is a way we can achieve this automatically without fluffing around manually adding products to collections.

---

How To Set Up A Discount Code That Excludes Sale Items

  1. You're going to edit all your full priced products to have a 'Compare at price' of 0.
  2. You're going to create an Automated Collection (or Smart Collection) that automatically fills with all products that have a 'Compare at price' of 0 (ie. all of your full priced products)
  3. You're going to create a discount code that applies only to that automated collection of your full priced products.

Any future products or price changes to your products should follow the following rule:

If your product is on sale, then your 'Compare at price' = the usual strikeout price (eg. 99.95)
If your product is not on sale, then your 'Compare at price' = 0

If you stick to the above, your discount code will never apply to sale products!

---

Step 1 - Double Check Your Theme Hides 'Compare at price' = 0

Every theme we've worked on hides the 'Compare at price' on the product page when it is set to 0 by default. It's always best to double check however.

  1. Select any product while you're in Shopify Admin
  2. Navigate to the price area
  3. Edit Compare at price to 0
  4. Check the product on the front end of your store
  5. Confirm that the a '$0.00' does not display next to the current price.

If you just see the standard price on the front end, go ahead and continue rolling this out for all products.

Edit Compare at price to 0
Correct pricing appearance when 'Compare at price' is less than 'Price'
Incorrect pricing appearance - 'Compare at price' should not appear in this instance.

---

Step 2 - Bulk Edit 'Compare At Price' = 0

You can use Shopify's inbuilt bulk editor, or you can export your products and reimport them.

Using the Bulk Editor inside Shopify Admin (easiest method):

  1. In Shopify admin, navigate to Products
  2. Click the checkbox to Select All Products
  3. Click the prompt to 'Select all 50+ products from your store'
  4. Click 'Edit products'
  5. Shopify will load the bulk editor
  6. If the Compare at price column is not visible, click 'Add fields' and select Compare at price
  7. Select any cells where Compare at price is empty  - you can shift + click to select a range.
  8. Type 0 with the cells selected and it will fill all selected cells with 0
The goal is to change any full priced product (which is any product that does not have a compare at price), to have a compare at price of 0.
Steps 2 - 4 - Select 50+ products and edit them
Steps 6 - 8 - Change the Compare at price to 0 for all full priced products

Using import & export (if you have a lot of products):

  1. In Shopify admin, navigate to Products
  2. Click the checkbox to Select All Products
  3. Click the prompt to 'Select all 50+ products from your store'
  4. Click Export Products
  5. Shopify will export the products to a .CSV (spreadsheet file) - usually to the relevant email account if the file is large
  6. Open up a Google Sheet (or Excel, but we always recommend Google Sheets).
  7. Import the file you just downloaded (directly from Shopify, or from the email it sent the file to)
  8. Find the Compare at price column
  9. Select any cells where Compare at price is empty (these are full priced products)
  10. Enter 0 for any of these cells
  11. Save, export, or download the file as a .CSV
  12. Inside Shopify > Products screen, click import
  13. Import the file, and all of your products will be updated from that spreadsheet.

---

Step 3 - Creating An Automated (Smart) Collection For Full Priced Products

This Automated Collection will automatically stay updated with all of your full priced products (ie. products that have a Compare at price = 0).

  1. In Shopify admin, navigate to Products > Collections
  2. Click Create Collection
  3. Name the collection what you like - I recommend naming it something logical for customers - 'Our Range', 'Customer Favourites' etc.
    Keep in mind that this collection will be findable by both Google and customers using search on your store, even though we won't link to it from any navigation area, or promote it.
  4. Under 'Collection type', select 'Automated'
  5. Under 'Conditions', select 'all conditions'.
  6. Add a condition for:
    Compare at price is equal to $0
  7. Make the collection only Visible to your Online Store sales channel. It is irrelevant for any other sales channels you may have installed.
This automated collection will now populate with all of your full priced products (ie. products with Compare at price = 0)
Steps 3 - 6 - Create an Automated Collection with a condition for Compare at price = 0

---

Step 4 - Creating A Discount Code That Only Applies To Your Full Priced Collection

  1. In Shopify admin, navigate to Discounts
  2. Click Create Discount and select Discount Code
  3. Fill out the Discount Code for whichever type of discount you need.
    If you're creating a sign up offer you can usually use something like:
    Discount code = WELCOME10
    Type = Percentage
    Discount Value = 10
  4. In 'Applies to', select 'Specific Collections'
  5. Select the automated collection you created in the previous step.
    This means this discount code will now only apply to all of your full priced items inside of the automated collection.
  6. Add any other additional requirements you wish, like minimum purchase value, or usage limits.
  7. When you're ready click save.
Steps 3 - 5 - Create a discount code that applies to your Automated Collection

---

Remember To Keep Using Compare At Price = 0

You'll now have a discount code that will not apply to sale products on your store.

It will always automatically update for any new products you add to your store, or any new items you add a sale price to, as long as you stick with the following rules:

Any future products or price changes to your products should follow the following rule:

If your product is on sale, then your 'Compare at price' = the usual strikeout price (eg. 99.95)
If your product is not on sale, then your 'Compare at price' = 0