tutorial: https://docs.medusajs.com/resources/how-to-tutorials/tutorials/product-builder#content
Thanks for the helpful tutorial on Product builder! I’m a bit confused about one step: where does cartWithMainProduct come from?
In the workflows/add-product-builder-to-cart.ts file, it seems to skip directly from step 2 to step 5 for adding complementary and add-on products.
Is cartWithMainProduct simply a refetch of the cart after adding the main product(s)?
entity: "cart",
filters: { id: input.cart_id },
fields: ["id", "items.*"],
}).config({ name: "refetch-cart-after-main-add" })
// convenience: resolve the single cart object
const cartWithMainProduct = transform({ cartRows: cartRows as any }, ({ cartRows }) => cartRows?.[0] as any) ```