Removing a free gift from Checkout page

Hi,

I have a scenario where if a customer enters a coupon code and the free gift discount is no longer applicable, how do I remove it from the cart?

If the customer is on the cart page, then I can remove it easily via cart/update.js
but user will apply discount coupon only on checkout page and I understand that on checkout page, checkout UI extension is only for plus users. please help if there are any other options..

Hi Gaurav,

From digging into this, it does look like implementing this logic on checkout will require being able to use either Shopify Functions or Checkout UI extensions - so the store would need to be on the Plus plan.

Thanks Liam for the confirmation. I guess this would be faced by all non Shopify Plus stores using any sort of Add Gift to cart then who dont want discounts to combine with free gift product. Because discount is always entered at checkout and non of the apps would be able to remove the free gift from the cart at that stage if it becomes non zero..

is there any other way to give 100% discount to a free gift in cart without using discount functions?