Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bundle-components-transaction.md
Original file line number Diff line number Diff line change
@@ -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.
19 changes: 19 additions & 0 deletions packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {CountryCode} from './country-code';
import {TaxLine} from './tax-line';
import {Money} from './money';

export interface Cart {
/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down