How to reject discount codes at Shopify checkout with Checkout Guardian

Checkout Guardian

How to reject discount codes at Shopify checkout with Checkout Guardian

A welcome code can make sense for a first purchase and still be the wrong fit for a cart that contains a limited-edition item. A regional promotion can work in one market while creating confusion in another. And when a code is rejected, a message like “Sign in to use this code” gives the shopper a clear next step.

Reject Discount Code in Checkout Guardian lets you decide which discount codes to reject, when to reject them, and what shoppers see when they try to use them. You can set up multiple rules for different products, customers, cart thresholds, and markets. Each rule can have its own schedule and rejection message.

How discount code rejection works

Checkout Guardian uses a Shopify Function to check the codes shoppers enter at checkout. When an active rule matches and Shopify allows the entered code to be rejected, the code is removed from the cart and the shopper sees your rejection message.

A product condition can trigger the rule for the entire cart. For example, if you set up a rule to reject WELCOME10 when a limited-edition product is present, the code is rejected for the whole cart, including any other products the shopper added. Shopify’s Discount Function documentation

Choose which discount codes to reject

OptionWhat it doesWhen to use it
All Discount Codes (Shipping, Order and Product Codes)Rejects all entered codes that Shopify allows the function to reject when the rule matches.Pause code use during a promotion or exclude carts containing products that should never be purchased with a discount code.
Specific Order Discount CodesRejects the order discount codes you select when the rule matches.Require shoppers to sign in before using a particular order-wide code, or restrict it to carts that meet a spending threshold.
Specific Product Discount CodesRejects the product discount codes you select when the rule matches.Restrict a particular product promotion when the cart contains items from an excluded collection.

For either specific-code option, you can select multiple codes of the corresponding type. Give codes separate rules when they need different conditions or customer-facing messages.

Choose when the rule applies

Each rule has a Pick a Setting option. Choose Always for broad coverage, or select Products, Customers, Cart, or Markets to define when it runs. Create separate rules for separate scenarios.

Always

Choose Always to apply the rule across all products and carts while it’s active. Pair it with All Discount Codes to pause code use storewide during a promotion. Pair it with a specific-code option to pause selected codes across the store.

Products

Use a product condition when the contents of the cart should determine whether a code is rejected.

  • Specific Products triggers the rule when the cart contains any of the products you select. This works well for a limited release, a bundle, or a product with a fixed promotional price.
  • Product Tags lets you target products with tags such as no-discount or limited-edition. Choose Any to match a cart containing a product with at least one selected tag. Choose Not Any to match when none of the products in the cart have any of the selected tags.
  • Product Collection triggers the rule when the cart contains an item from any selected collection. Use it for groups you already manage in Shopify, such as Clearance, New Arrivals, or Limited Editions.

Example. Choose Product Collection, select Clearance, and choose Specific Order Discount Codes with WELCOME10. When a shopper adds a clearance item and enters that code, show “WELCOME10 can’t be used on carts containing clearance items.”

Customers

Use a customer condition when access to a code depends on the shopper’s account or customer group.

  • All (logged-in & logged-out customers) applies the rule to shoppers in either sign-in state.
  • Logged-in customers targets shoppers who have signed in.
  • Logged-out customers targets shoppers who are checking out while signed out. Use this when shoppers should sign in before trying an account-based offer.
  • Customer Tags targets shoppers based on tags such as VIP or wholesale. Any matches shoppers with at least one selected tag. Not Any matches shoppers with none of the selected tags, including shoppers whose checkout has no identified customer.
  • Specific Customers lets you select individual customer accounts.
  • Customer Segments lets you select Shopify customer segments. Checkout Guardian looks up the customers in the selected segments when you save the rule. The selected segments must return at least one customer.

Example. Choose Logged-out customers and select the order code MEMBER15. Show “Sign in to your account to use MEMBER15.” If you use a VIP tag to control access to a different offer, create a rule for that code with Customer Tags set to Not Any for VIP.

Cart

Use a cart condition to reject a code based on what the shopper is spending or how many units they’re buying.

Cart conditionWhat it checksExample rejection condition
Subtotal AmountThe cart subtotal reported by Shopify.Reject SAVE15 when the subtotal is less than $100.
Total AmountThe cart total reported by Shopify.Reject a selected code when the cart total is greater than $500.
Total QuantityThe sum of item quantities across the cart. Three units of one product count as three.Reject BUY3 when the cart contains fewer than three units.

You can compare the selected value using greater than or equal to, greater than, less than or equal to, less than, or equal to. Set the comparison for the carts where the code should be rejected. For a code that requires a subtotal of $100 or more, choose Subtotal Amount → Less than → 100. A cart at exactly $100 falls outside that rejection rule.

Markets

Use Markets when a promotion has different rules by region. Select one or more of your store’s Shopify markets. Checkout Guardian uses the countries associated with those markets to match the shopper’s checkout. For a country-specific restriction, select a market configured for that country.

Example. If USWELCOME is intended for your United States market and should be rejected in your Canada market, select Canada and add USWELCOME under Specific Order Discount Codes. Show “USWELCOME is available for orders in our United States market.” Select any additional markets where the same rejection should apply.

Write the message shoppers will see

Each rule has a Rejection message field with a limit of 120 characters. Use it to explain why the code was rejected and, where possible, what the shopper can do next.

ScenarioExample rejection message
A product in the cart triggers the rule“This code can’t be used on carts containing Limited Edition items.”
The shopper needs to sign in“Sign in to your account to use MEMBER15.”
The cart is below the minimum subtotal“Add more items to reach a $100 subtotal and use SAVE15.”
The cart needs more units“Add at least 3 items to your cart to use BUY3.”
The promotion is limited to a region“USWELCOME is available for orders in our United States market.”

Write the message around the condition you configured. If the rule checks the subtotal, say “subtotal” so the shopper knows which amount matters. If the rule rejects every eligible code during a promotion, use wording that makes sense for any code the shopper enters.

Create and test your first rule

  1. Open Checkout Guardian → Reject Discount Code and choose Create New Rule.
  2. Enter a rule name you can recognize later, such as “Reject WELCOME10 on clearance carts.”
  3. Set the start date and, for a temporary rule, add an end date.
  4. Under Pick a Setting, choose Always, Products, Customers, Cart, or Markets and fill in the relevant details.
  5. Under Discount codes to reject, choose one of the three options. If you’re targeting specific codes, select them.
  6. Write the rejection message, save the rule, and make sure it’s enabled.
  7. Test a checkout that should trigger the rule and confirm that the code is rejected with the expected message. Then try a checkout outside the rule’s conditions. For a threshold rule, also test the exact threshold.

You can keep several rules active for different offers. For example, reject WELCOME10 on clearance carts, reject MEMBER15 for logged-out shoppers, and reject BUY3 when the cart contains fewer than three units. Each rule gives shoppers a message specific to the code and the situation.

Open Reject Discount Code in Checkout Guardian and start with one promotion. Choose the code, define when it should be rejected, and give shoppers a clear explanation at checkout.

Leave A Comment