Build a Shopify cartTransform Function using the expand operation to display bundled component items from a single parent cart line

domain: shopify.dev · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.dev, checked against official docs, with linked verified routes.

Steps

  1. Scaffold a new cartTransform Function with `shopify app generate extension --type cart_transform` and set the API version to 2025-07 or later
  2. In `run.graphql`, query the cart lines you want to expand, including the merchandise ID and any metafield flags that identify bundle parent lines
  3. In your Function's `run` entry point, return an `ExpandOperation` for each bundle parent line: set `expandedCartItems` to an array of component merchandises with their quantities and optional fixed prices
  4. Set the `image` and `title` override on each expanded item if you want components to display with custom presentation in the cart UI
  5. Deploy with `shopify app deploy`; the Function target is `cart.transform` — confirm it appears in the Partner Dashboard under Extensions
  6. Test on a development store by adding a bundle product to cart and inspecting that the expanded components appear as separate line items

Known gotchas

Related routes

Build a Shopify cartTransform Function using the merge operation to group multiple compatible cart lines into a single bundle parent presentation
shopify.dev · 6 steps · unrated
Build a Shopify cartTransform Function using the update operation to override the price of a cart line item for custom pricing logic
shopify.dev · 6 steps · unrated
Read cart line data inside a Shopify Checkout UI Extension using useCartLines and other checkout API hooks
ecommerce-ops · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans