Skip to content
Kitenzo Headless is currently invite-only. To enable it on your store, email support@kitenzo.com.

Cart & discount application

This is the detail most worth getting right. Kitenzo doesn’t discount at request time — the Shopify cart transform applies the bundle discount at checkout. Your job is to give the cart the data the transform needs.

Bundle typeWhere the discount livesWhat you must do
single-productIn the variant priceAdd the configured variant. Nothing extra.
multiple-productsIn the variant priceAdd the configured variant. Nothing extra.
nativeApplied at checkout by the cart transformAdd one line per variant with _bundle_data, and write the cart-level _bundles attribute.
  • _bundle_data — a per-line attribute that ties each cart line to its configured bundle. The SDK’s buildCartLines adds it automatically. If you reconstruct lines by hand (e.g. restoring a saved cart), every native-bundle line must carry it.
  • _bundles — a cart-level attribute (JSON) mapping configuredBundleId → bundle content. The cart transform reads it to apply the discount. Set it via buildCartPayload / addBundleToCart, or write it yourself from the embed’s bundleContent.
const result = await client.submitBundle(bundle, selections); // or useBundleCart()
await addBundleToCart(result, {
addLines: (lines) => cart.linesAdd(lines),
getAttributes: () => cart.attributes ?? [],
setAttributes: (attrs) => cart.cartAttributesUpdate(attrs),
});

addBundleToCart (and buildCartPayload) inspect the bundle type and only write _bundles when needed — so the same code is correct for all three types.

The embed gives you everything in the onAddToCart payload — add lines, and if bundleContent is present (native), write it into _bundles. See Cart integration.

  • Inspect the cart’s attributes: a native bundle should have a _bundles entry keyed by the configured bundle ID.
  • Each native-bundle line should carry a _bundle_data attribute.
  • The discount itself appears at checkout (the transform runs on Shopify’s servers), not necessarily in an intermediate cart subtotal.