Bundle function (cart transform) · Plan: Basic
How do I sell a bundle product that expands into its real components at checkout, so inventory is tracked per item?
Use a bundle (cart transform) function with an expand rule. The component list lives in a product metafield on the bundle product. When that product is added, checkout expands the line into the component variants at the bundle's price. No theme changes, any Shopify plan.
- Function typeCart transform (bundle)
- Plan neededBasic
- Shopify PlusNot required
- TemplateShips in the app as "Fixed bundle"
- Updated
What the shopper sees
They add the “Starter kit” product. In cart and checkout it shows as the Starter kit with its components listed underneath. The order contains the component variants, so each one’s inventory is decremented and the warehouse picks real SKUs.
How the rule is built
The Fixed bundle template creates an expand rule:
- Create a JSON product metafield, for example
custom.bundle_components. - On each bundle product set it to a list of
{ "id": "gid://shopify/ProductVariant/…", "quantity": n }entries. - The rule matches lines whose product has that metafield and expands them using
idandquantityfrom the entries. - Each component line gets a
_bundleProductIdattribute pointing at the bundle, so components from different bundles are never merged by Shopify.
Price: by default the components keep the bundle product’s price (the bundle product’s own price is the bundle price). You can also set a percentage decrease or fixed price per unit on the components.
Variations
- Components from a line property instead of a metafield. Useful when an app or quiz decides the contents per order.
- Several bundles. Every product with the metafield is a bundle; no extra rules needed.
- Bundle price from component prices. Use percentage decrease to price the bundle as “components minus 15%”.
Limits to know
- One bundle function active per store at a time. Fixed and mix and match rules can live in the same function (Advanced for more than one rule).
- Not compatible with selling plans (subscriptions).
- Component variants must be available for sale and have inventory, or checkout will flag the bundle as unavailable.