How to block certain products from a discount code on Shopify
This article was originally published by one of the great devs on Storetasker: Shastri Haines.
In order to exclude certain products from discount codes you will need to setup a new collection and then update your discount code conditions.
1. Create a New Collection
The new collection will only contain products that you want to discount, you could call it something like “Discountable Items” or “Non-Sale Items”.
There are a couple of ways you could setup the collection:
- Automated Collection where Product Tag = Discountable
You would then need to tag each product you want to be added to the collection. - Automated Collection where Compare at Price is Empty
This will automatically add in products that don’t have a Compare at Price in the product data. This means that any products that aren’t on sale (with a marked down price) will be added to the collection.
2. Update Discount Codes
Now that we’ve got a new collection of items which should receive discounts, we will need to amend our existing discount codes to only be applicable to this collection.
- Go to the discounts page in your admin.
- Find the discount you want to edit & click into it
- Scroll down to the “Applies to” section and change it to Specific Collections.
- Find your newly created collection and select it.
- Press Save.
The discount code will now only work on items that are a part of that collection.
That's it - those are the 2 steps. If you need further help, just submit a request here and one of our devs will work with you!