Custom product add-on system in Dawn theme (not using variants)

Hi everyone,

I’m implementing a custom product add-on system in Dawn theme (not using variants).

The main product has a metafield linking to an add-on product. When the customer adds the main product to cart, the add-on is auto-added as a separate line item.

Adding works perfectly — the problem is with quantity syncing.

The Issue

When the customer changes the main product quantity inside the Cart Drawer, Shopify updates the main line item immediately, but the add-on quantity becomes one step behind.

Example:

  • Add main product → add-on added (qty 1) ✔️

  • Change main product to qty 2 → add-on stays 1 ❌

  • Change main product to qty 3 → add-on updates to 2 ❌
    So the add-on always reflects the previous quantity, not the new one.

What I need
Whenever the main product quantity changes (plus/minus or manual input), the add-on should instantly match the same quantity — in real time — without waiting for the next update cycle.

What I’ve tried
  • Intercepting /cart/change.js and /cart/update.js

  • Patching Dawn’s cart-items and cart-drawer-items updateQuantity()

  • Listening to all cart update events (cart:updated, cartChange)

  • Syncing via /cart.js fetch

  • Even monkey-patching render timing to fire before Dawn re-renders

But the result is still the same:
The add-on always updates one quantity cycle late.

Has anyone successfully implemented real-time quantity syncing between two separate line items in Dawn?
Would love to know if there’s a recommended pattern or known workaround.

Thanks!

Yes because it’s a custom system needing custom javascript.
There is no native “addon” system in shopify.
If you need things to go together use bundles, but you will not be able to have different dynamic quantities.

Either send all the items at once with same qty or , in sequence through the ajax api.
With either custom code replacing whats there, or patching the existing functions like updateQuantity()

If this is too advanced then reach out to me for customization services.
CLICK my profile-pic or visit my profile on the forums
ALWAYS include context in new communications, e.g. reference urls, posts urls, etc