Skip to main content

Setting up the Discount Code Rejection extension

Offer shoppers an alternative discount when their coupon code is rejected at checkout

Updated over a week ago

The Discount Code Rejection extension automatically offers shoppers a replacement discount when they enter an invalid coupon code at checkout. Instead of losing the sale, you catch the rejection and present an alternative offer — all in real time.

How to set it up

Go to Checkout Components in the left-side menu, then click Add Component and select Discount Code Rejection.

Step 1: Set up your coupon matching rules

Each configuration maps a rejected code (or pattern of codes) to a replacement offer. You can create multiple configurations to handle different scenarios.

Coupon Rules: Define which rejected codes should trigger this replacement. Options include exact match, prefix match, and regex patterns. For example, you can catch any code starting with "SUMMER" or match a specific code like "EXPIRED10".

Step 2: Choose your replacement discount

Pick how the replacement discount works:

  • Create Discount — PDQ generates a unique, one-time-use coupon code for each shopper. You set the discount type (percentage or fixed amount), the value, and how many days until it expires.

  • Existing Discount — Point shoppers to a coupon code that already exists in your Shopify store.

  • No Discount — Show a message without offering a discount (useful for informational messaging like "this code has expired").

If you choose Create Discount, you can also configure combination rules — whether the generated coupon can combine with order discounts, product discounts, or shipping discounts.

Step 3: Customize the widget

Choose how the replacement offer appears to shoppers:

Widget Type

  • Banner — An informational message. Good for when the discount auto-applies or you just want to show a note.

  • Clickable — A banner with an "Apply Discount" button. The shopper clicks to apply the replacement code. You can customize the button text (default: "Apply Discount").

Appearance — Set the background color (info, success, warning, or error), text color, button style, and button corner radius to match your store's look.

Auto-Apply — Toggle this on to skip the button entirely and apply the replacement discount automatically when the rejection is detected.

Step 4: Write your message

Customize the Title and Description that appear in the widget. Both fields support rich text and dynamic fields:

  • {replacement_discount} — inserts the replacement coupon code

  • {customer_name} — inserts the shopper's first name

  • {customer_lastName} — inserts the shopper's last name

Example title: "That code didn't work — but here's {replacement_discount} just for you, {customer_name}!"

Good to know

  • Generated coupons are one-time-use and restricted to the specific customer (when their email is available).

  • The extension uses PDQ's Web Pixel to detect coupon rejections. Make sure your Web Pixel is active.

  • Rejection data is stored temporarily (180 seconds) — the offer appears within a second of the rejection.

  • You can create multiple configurations to handle different code patterns with different replacement offers.

That's it! And as always, don't hesitate to reach out to support@prettydamnquick.com if you have any questions.

Did this answer your question?