EnrichedCartLine

interface EnrichedCartLine { id: number; packageId: number; quantity: number; price: { excl_tax: { value: number; formatted: string }; incl_tax: { value: number; formatted: string }; original: { value: number; formatted: string }; savings: { value: number; formatted: string } }; product: { title: string; sku: string; image: string }; is_upsell: boolean; is_recurring: boolean; interval?: 'day' | 'month'; is_bundle: boolean; bundleComponents?: number[]; }

Source: global.ts:1113

A cart line prepared for display: the same item as CartItem but with a structured price breakdown (with/without tax, original, savings) and product details ready to render. This is the shape next.getCartData().cartLines returns, built from the cart's items on each call. The data-next-display fields read the stored CartItem instead.


Properties

id: number

Cart line ID (matches CartItem.id).

packageId: number

The package ref_id for this line.

quantity: number

Number of packages on this line.

price: { excl_tax: { value: number; formatted: string }; incl_tax: { value: number; formatted: string }; original: { value: number; formatted: string }; savings: { value: number; formatted: string } }

Price breakdown, each as a raw value and a display formatted string.

Properties

  • excl_tax ({ value: number; formatted: string }) — Line total after discounts. The cart calculate API reports no tax, so this matches incl_tax.
  • incl_tax ({ value: number; formatted: string }) — Line total after discounts. The cart calculate API reports no tax, so this matches excl_tax.
  • original ({ value: number; formatted: string }) — The highest compare-at figure the line carries: its retail price, else its price before offer discounts.
  • savings ({ value: number; formatted: string }) — original minus the line total, never negative.

product: { title: string; sku: string; image: string }

Product details for rendering.

Properties

  • title (string)
  • sku (string)
  • image (string)

is_upsell: boolean

true if added via a post-purchase upsell.

is_recurring: boolean

true for subscription/recurring lines.

interval: 'day' | 'month'

Billing interval for recurring lines.

is_bundle: boolean

true when one selector put this line and at least one other in the cart, as a bundle selector does.

bundleComponents: number[]

Cart line IDs of the bundle's other lines. Absent unless is_bundle.