GitHub

DaffCartItem

A cart item. Cart item types correspond to product types. They hold information about the product to which they correspond and how many of said product is in the cart.

import { DaffCartItem } from '@daffodil/cart'
interface DaffCartItem {
  type: DaffCartItemInputType
  image: DaffProductImage
  product_id: DaffProduct['id']
  parent_item_id: ID
  sku: string
  name: string
  qty: number
  price: number
  row_total: number
  in_stock: boolean
  discounts: DaffCartItemDiscount[]
}

Properties

Name Type Description
type DaffCartItemInputType

The type of cart item.

image DaffProductImage

The image or thumbnail of the corresponding product.

product_id DaffProduct['id']

The ID of the corresponding product.

parent_item_id ID
sku string
name string

A human-readable label.

qty number

How many of the corresponding product is in the cart.

price number

The price per item, excluding cart discounts. This includes any discounts and sales that apply to the product or category.

row_total number

The total for the entire row, not including cart discounts. This includes any discounts and sales that apply to the product or category.

in_stock boolean

Whether or not the specified quantity of the corresponding product is in stock.

discounts DaffCartItemDiscount[]

A list of discounts applied to the cart item row.