How to Block Any Coupon When Paying via Gift Card

Im thinking about a way to improve the use of gift cards on my store. As gift cards are merly a method of payment, there’s no way, via admin panel, to set rules for its usage.

Straightforward question: how can I block the use of any coupon in my store whenever the payment is made using gift card?

@hdelara_1 Shopify does not allow this, however, if you are using Shopify Plus you can do it with the help of a code. For Non-Shopify Plus users need an app to achieve this.

For Shopify Plus-- IN setting of the checkout go to the script editor and create a logic

if Input.cart.payment_methods.any? { |payment| payment.type == “gift_card” }
Input.cart.discount_code = nil # Remove applied discount code
end

Output.cart = Input.cart

This script will detect if a gift card is used and will remove any discount applied to the cart.

Thanks for the feedback. Im not a Plus user, so I guess I’ll have to use an app.

@hdelara_1 Please let me know if you need any more assistance.

@hdelara_1 ,

  1. If you’re on Shopify plus - it’s possible to remove any applied discount codes on the cart through a checkout extension that checks for any gift cards are applied and then proceeds to remove any discount codes automatically. (API reference) - fairly straightforward to build for you as well.

    Or this can be implemented as a checkout block through the checkout validation API as well.

  2. If you’re not on plus - Discounts / Functions have no way of knowing if a gift card is applied on the cart or not. So there is no option to achieve this behavior that you’re looking to achieve. (reference)

If this helped - can you please mark this as a solution so that others who stumble into this thread can find the right answer.

Best wishes,

@hdelara_1 Since quite some time has passed since you raised this thread, I’m assuming you’ve already reached at a solution :slightly_smiling_face:

If my answer helped - can you please mark it as a solution so others who stumble across this thread down the line can also find value from it.

Best,

@hdelara_1 as others have said you one option is custom code for plus users to stop discount code & giftcard stacking or you can use the PromoLock app to do this on any store.

Worth flagging for anyone landing on this thread: Shopify deprecated the Script Editor, and the migration deadline (August 2025) has already passed. So the Ruby script approach mentioned above is no longer a viable option, even for Plus merchants.

For Plus stores, the current path is through Checkout Extensibility. The checkout validation API lets you write a function that runs at checkout submission - you can check whether a gift card is among the applied payment methods and reject the checkout if a discount code is also present. Alternatively, a Checkout UI Extension can detect the gift card and strip the discount code dynamically before the customer completes the order. The Gift Cards API in checkout extensions does expose this data, so it’s technically workable for a developer to implement.

For non-Plus, the constraint Abel_Lesle described is accurate and hasn’t changed - Discount Functions simply don’t have visibility into payment method data, so gift card detection isn’t possible at that layer. An app that integrates directly with the checkout is the only realistic workaround, and there are a handful on the app store targeting exactly this stacking scenario