S8 · conceptual understanding
Bundles and shared component pools
Explains which record owns a bundle's units, how a shared component pool sets real availability, and how Cart Transform and bundle apps differ.
"My gift set says 40 available, I have 30 pens, and when a set sells the mugs don't move." The storefront and the shelf are describing different things, and neither of them is wrong in isolation. The problem is that a bundle has no inventory of its own. It is a promise about components, and a promise does not have a quantity — it has a limit, computed from what the components can support.
Once you accept that, most bundle bugs stop being mysterious. They are all versions of the same question: which record owns the unit?
Availability is a floor, not a count
A bundle that needs q units of each of several components can be built a number of times equal to the smallest of the component supplies:
bundles buildable = min over components of floor(available_component / q_component)
With the gift set's BOM from Dependent demand and gross-to-net — one mug, one notebook, one pen — and stock of 40 mugs, 15 notebooks and 30 pens:
mugs: floor(40 / 1) = 40
notebooks: floor(15 / 1) = 15
pens: floor(30 / 1) = 30
bundles buildable = min(40, 15, 30) = 15
Fifteen sets, not forty, not thirty, and certainly not the 120 units of season demand. The notebook is the constraint, and it will be the constraint until it is replenished — at which point the pen takes over until 30 sets. The formula also tells you exactly what to buy: the marginal set is gated by whichever component has the least cover relative to its quantity per.
The double-count failure
Here is the failure in its most common form. The store creates GIFT-SET-01 as a product with 40 units of inventory, because there are 40 mugs and it feels like 40 sets. The components are also tracked. The gift set is a plain Shopify product with no bundle mechanism behind it, so a set sale decrements the gift set's own count and nothing else.
Now sell 12 sets.
| Record | Before | After 12 sales | Truth |
|---|---|---|---|
GIFT-SET-01 |
40 | 28 | 15 buildable (notebook-limited) |
MUG-GRN-12 |
40 | 40 | 28 |
NB-A5-01 |
15 | 15 | 3 |
PEN-BLK-01 |
30 | 30 | 18 |
Two separate corruptions in one table. The bundle number, 28, was never a quantity of anything — it started life as the mug count and has been decaying at the rate of set sales, with no relationship to the components that actually gate it. And the component counts did not move at all, so the store will happily sell 40 more mugs as singles against 28 mugs that exist, and will keep advertising sets it cannot build. The notebooks are the tell: 15 on record, 3 on the shelf, and the discrepancy will not be found until someone counts.
The double count is not arithmetic error. It is two records each claiming to describe the same physical units, with only one of them connected to the event that consumes them. Any system that holds both a bundle quantity and its component quantities, and decrements only one, produces this drift by design.
A second, subtler version happens when the bundle is physically assembled — boxed gift sets on a shelf — and the components are still decremented on sale. Then 40 boxed sets and 40 mugs are both on the balance sheet, representing the same 40 mugs. Inventory value is overstated, availability double-counts, and every sale reduces the total at twice the true rate.
Shared pools across variants and parents
The same mechanism runs between bundles. Suppose the pen is used by GIFT-SET-01 at one unit and by a stationery trio at two units, and there are 30 pens.
gift set availability, computed alone: floor(30 / 1) = 30
trio availability, computed alone: floor(30 / 2) = 15
pens actually available: 30
Each parent's figure is correct only if the other never sells. Together they promise 45 sets' worth of pens against 30. This is the shared-pool problem, and it is why availability for a bundle has to be computed against uncommitted stock — on hand minus what other live parents and independent demand will take — rather than against the raw count.
The same logic applies to variants. A two-pack of the navy hoodie draws two units from the same variant pool that the single hoodie draws one from. A colour family sold in six shades off one shared blank is one pool with six parents. The pool does not care which parent wins; the merchant has to decide, and that decision is a policy: a reservation order (sets before singles, or best-margin first), or a hard split of the pool that each parent may draw from. Without one, the answer is whatever the sales pattern happens to produce.
Cart Transform versus bundle apps
Two implementation families exist, and they differ in where the deduction happens.
Cart Transform. A Shopify Function rewrites the cart, expanding a bundle line into its component line items before the order is created. The bundle variant exists on the storefront for presentation, but the components are what get ordered, fulfilled and decremented — so the components remain the only record. No sync job, no lag. As of 2025 the mechanism requires the bundle to be presented as a variant that the function can match, and the quantity the storefront shows still has to be derived from components by something — typically by keeping the bundle variant's own inventory off and letting the component gate availability in a theme or app layer. It also only covers online checkout: a POS or marketplace sale of the same bundle needs its own path, which is where a store that "fixed" bundles often still oversells.
Bundle apps. Typically the app maintains the bundle's inventory by watching component webhooks and writing a computed quantity to the bundle variant. The discount is simpler to configure and it works across more surfaces, including POS and some marketplaces. The cost is the sync interval: between a component sale and the app's write-back, the bundle is over-advertised by however many units sold in that window. On a low-velocity SKU that window is harmless; on a launch it is the oversell.
Neither is wrong. The choice is which failure you can tolerate — transformation missing a channel, or sync advertising stock for a few seconds after it has gone. Write the answer down; it determines where the reconciliation report lives.
Where this breaks
- Physically assembled bundles. If the set is boxed and shelved, it is an item, and treating it as a virtual bundle understates pickable stock while overstating the shelf. Pick one representation per physical reality and never both.
- Returns. A returned gift set comes back as one line item; three components have to be credited. Without a reverse explosion the components stay short.
- Substitutes. A bundle that can ship with a blue pen when black is out has a flexible BOM. Availability computed from a fixed BOM understates what you can actually sell, and margin leaks as the substitution cost is absorbed at the same price.
- More than two or three bundles on one component. The reservation logic becomes a planning problem rather than a rule, and hand-maintained splits drift within a month.
- The bundle nobody decrements. Any channel that can sell the bundle without going through the deduction path — POS, a marketplace listing, a wholesale invoice — will produce exactly the drift described above, at wholesale volume.