To make a Shopify discount code exclude products, first check the code's settings in Shopify admin. If you control the code, you can limit it to specific products or collections. BlockCart can instead stop checkout when a selected product is in the cart and a discount is applied to any cart line.
Shopify's discount code settings are the first option when you want eligible items to receive a discount while excluded items remain at full price. Use the BlockCart rule below when you want to reject the whole checkout if those items and a discount appear together.
Before you start
You need an active BlockCart subscription to save a rule. Choose the products to protect. If you want a Shopify discount code to exclude sale items, select those sale items here. The rule also catches automatic discounts.
Create the checkout rule
- On the BlockCart home page, select Create new rule. In the dialog, select Cart and checkout validation.
- Enter a Rule name. Choose Standard input under Rule input.
- Under Eligibility, select Only when conditions match. Set Cart contains to at least one selected product. Select Select products and pick the products you want to protect.
- Select Add condition (AND) in the same group. Choose Line item discount, set it to is, and leave the value as
true. - Write an Error message that tells the customer what to change. Set Status to Live, then Save. Test in Shopify checkout with a protected product and a discount.

Example
| Rule input | Conditions | Error message |
| ------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Standard input | Cart contains → at least one selected product: sale item AND Line item discount is true | Remove the sale item or the discount before completing your order. |
Good to know
- This rule checks whether a protected product is in the cart and any cart line has a discount. It cannot tell which product received the discount. A customer can be blocked even when only a different product was discounted.
- BlockCart cannot read discount code text or distinguish a code from an automatic discount. The rule can block either type of discount. A shipping-only discount does not satisfy Line item discount.
- To check for a nonzero discount application aimed at line items instead, use Order discount is
true. See Discount conditions: global, order and line item discounts for how these checks differ. - Rule input is locked after you create the rule. Product selections belong to your store; select them again if you import the rule into another store.
