Skip to content

Commit daf7139

Browse files
Adds bundle components to line item interface
1 parent 11d19b4 commit daf7139

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': minor
3+
---
4+
5+
Added optional `components` field to `LineItem` interface with new `LineItemComponent` type to provide properties of product bundle components.

packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {CountryCode} from './country-code';
22
import {TaxLine} from './tax-line';
3+
import {Money} from './money';
34

45
export interface Cart {
56
/**
@@ -53,6 +54,24 @@ export interface LineItem {
5354
* The currently selected selling plan for this line item.
5455
*/
5556
sellingPlan?: SellingPlan;
57+
/**
58+
* The components associated if LineItem represents a product bundle.
59+
*/
60+
components?: LineItemComponent[];
61+
}
62+
63+
/**
64+
* Product data for a single component in a line item bundle. Not including
65+
* uuid because we do not want any chance of these components being mutated.
66+
*/
67+
export interface LineItemComponent {
68+
title: string;
69+
quantity: number;
70+
price: Money;
71+
taxable: boolean;
72+
taxLines: TaxLine[];
73+
variantId?: string;
74+
productId?: string;
5675
}
5776

5877
/**

0 commit comments

Comments
 (0)