How to block automatic discounts via Checkout UI Extension?

I’ve encountered an issue when creating automatic discounts in the Shopify Checkout Blocks app.

For example, when applying a discount based on customer tags, there’s no option to specify eligible or ineligible products — the discount applies to all products for the eligible customer.

I’ve been exploring ways to implement a Checkout UI Extension that could check cart items and, if a specific product is in the cart, disallow the discount and show a message to the customer explaining that the discount doesn’t apply to certain products.

However, I haven’t found any method to block or disable automatic discounts — only ways to cancel manually applied discount codes.

Has anyone found a solution or workaround for this scenario?
Any ideas or suggestions would be greatly appreciated.

Thanks!

Perhaps amend your message before posting so it doesn’t sound completely like AI.

1 Like

Thanks for the reply, Steven.

I’m already familiar with the other methods for creating discounts — my main goal was to find a way to work with existing automatic discounts created through the Shopify Blocks app, not to build new ones from scratch.

Just wanted to confirm if there’s absolutely no way to intercept or restrict those pre-created automatic discounts during checkout.

How can it be possible to disable or enable automatic discount in Checkout UI extension?

As Checkout UI extension is client-side, and then disabling or enabling discount is Server-Side required.

You can create external custom backend and then you can use fetch request from your Checkout UI extension to backend. So backend will control the logic for controlling discounts!

e.g. we can disallow applied discount code with useApplyDiscountCodeChange().
thought maybe there’s something similar with the automatic discount.

That’s just the API for manual codes. It doesn’t make sense to have a similar API for automatic discounts because they are…. ‘automatic’

Exactly :slight_smile:

Automatic discounts require you to handle eligibility at application.
If an app doesn’t allow enough granular control for you, your best option is to see what other apps are available/build your own.