Follow-up: Zero-value order discount in Discount Function — now requires both order and product combinability toggles

Hi everyone,

Following up on my August thread which didn’t get a resolution. The behavior has changed since then, so sharing again with the full use case and current state.

Our use case

We’ve built a free-gift flow using Discount Functions + Checkout UI Extensions:

  1. A single code-based discount is backed by a Function that can return both order and product discount types from one code.

  2. The customer applies the code. At this point, the free gift is not yet in the cart.

  3. Since the gift isn’t there, the Function returns only an order discount with value 0. It’s not meant to reduce the total — it’s a marker, so the code stays applied and our checkout UI extension can detect it via useDiscountCodes().

  4. The extension reads the code, recognises it, and adds the free gift line to the cart.

  5. Cart changes → Function re-runs → gift is now present → Function returns a product discount (100% off the gift line). The order discount stays at 0.

The original issue (August)

When the Function returned a zero-value order discount with “combines with order discounts” OFF, checkout rejected it with:

“This discount can’t be combined with your existing discounts.”

  • Order = 0, combine OFF → fails

  • Order = 0.01, combine OFF → works

  • Order = 0, combine ON → works

  • Admin-created 0% discount, combine OFF → works

Enabling “combines with order discounts” was the workaround.

What’s different now

Enabling “combines with order discounts” alone is no longer enough. The discount fails unless the merchant enables both “combines with order discounts” and “combines with product discounts” — even though on the first run (before the gift is in the cart) the Function only returns the zero-value order discount and no product discount output at all.

Forcing merchants to enable both combinability toggles is a real UX problem — they don’t want a free-gift code combinable with every order-level and product-level discount in the store.

Is this behavior intentional, and is there a recommended pattern for this use case?

Thanks!

Please do not create duplicate posts. For follow-up, add a comment to the original post instead.

Closing this post.