When you hand out a lot of discount codes (say, dozens of welcome codes sent out by email) it gets hard to make sure the codes don't apply where you don't want them to: products with reduced prices, or simply products your margins are too thin on.
Code blocking rules give you control over which products your discount codes can apply to.
A rule watches the cart at checkout: if it contains a product you've protected, the code is rejected and the customer sees a message you set. Your existing Shopify codes stay exactly as they are — you don't even have to edit them.
How a blocking rule works
For each rule, you choose three things:
Which trigger products fire the rule — items on sale, or specific products, collections, vendors, or tags.
Which codes to reject — all codes; all except the codes you've created in Alpha Sale (Alpha Sale codes already have flexible exclusion settings, so there's no need to block them externally); or just specific codes.
Which rejection message to show the customer.
When a customer enters a discount code the rule is set to block and the cart contains at least one product that matches the rule's trigger, the code is rejected at checkout and your message is shown.
Availability and limits
1. Available on the Ultimate plan only.
2. In Alpha Sale, the limit for blocking rules is up to 10 blocking rules per store.
3. Each rule works as a Shopify automatic discount — applied to the matching cart but never shown to customers.
This keeps the shopping experience smooth, but it comes with one limitation: each rule counts toward Shopify's limit of 25 active automatic discounts per store. That limit is shared across all your discounts and discount apps, so if you hit it, you'll need to deactivate another blocking rule or any other active automatic discount (in this app or any other) to free up a slot.
Creating a rule
Go to Code blocking → Create rule:
Rule title — internal only, not shown to customers.
Triggering products — pick one trigger type.
Which codes to block — all or specific codes.
Checkout message — shown to the customer when their code is blocked.
Schedule — activate now, or schedule single / weekly / monthly launches, same as campaigns and codes.
Important notes
Blocking applies to the whole order. If even one triggering product is in the cart, the code stops working for the entire order — not just the matching items. This is a Shopify limitation.
Each rule uses one triggering condition (e.g. one collection, one tag, etc.). If you need more than one condition, simply create several blocking rules.
Only discount codes can be blocked — not automatic discounts and not gift cards.
Blocking doesn't change your codes. As soon as the rule stops applying (deactivated, or the product leaves the cart), the code works as usual again.

