How to Prevent Other Discounts When Using Order Discount Function (Scripts Deprecation)

I’ve built an Order Discount Function to apply 20% off when subtotal > €160. I need it to be exclusive — no other discount codes should be allowed. Since Shopify Functions can’t detect or disable discount codes, how can I programmatically block other applied discounts when mine is active? This was possible via Scripts but not with Functions.

Hi - I believe this may be possible to achieve using the Discounts Allocator Function API, but this is currently only available in developer preview. You should be able to use the DiscountApplicationStrategy enum to only allow a specific discount to apply.

@Drip_Development Just create the discount and don’t enable combination.

or

you can create an discount reject function which can take in custom conditions and reject discount codes except the one you wanna allow with an custom error message.

and than offer the discount you wanna offer.

or you can use an public app to do all this.