From daf7139684ef02410748f376171bd4408f8d38ee Mon Sep 17 00:00:00 2001 From: Alex Graffeo-Cohen Date: Tue, 9 Sep 2025 11:27:14 -0400 Subject: [PATCH] Adds bundle components to line item interface --- .changeset/bundle-components-transaction.md | 5 +++++ .../src/surfaces/point-of-sale/types/cart.ts | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .changeset/bundle-components-transaction.md diff --git a/.changeset/bundle-components-transaction.md b/.changeset/bundle-components-transaction.md new file mode 100644 index 0000000000..9297215380 --- /dev/null +++ b/.changeset/bundle-components-transaction.md @@ -0,0 +1,5 @@ +--- +'@shopify/ui-extensions': minor +--- + +Added optional `components` field to `LineItem` interface with new `LineItemComponent` type to provide properties of product bundle components. diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts b/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts index 8ab2576bfd..7d3c57eefb 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts @@ -1,5 +1,6 @@ import {CountryCode} from './country-code'; import {TaxLine} from './tax-line'; +import {Money} from './money'; export interface Cart { /** @@ -53,6 +54,24 @@ export interface LineItem { * The currently selected selling plan for this line item. */ sellingPlan?: SellingPlan; + /** + * The components associated if LineItem represents a product bundle. + */ + components?: LineItemComponent[]; +} + +/** + * Product data for a single component in a line item bundle. Not including + * uuid because we do not want any chance of these components being mutated. + */ +export interface LineItemComponent { + title: string; + quantity: number; + price: Money; + taxable: boolean; + taxLines: TaxLine[]; + variantId?: string; + productId?: string; } /**