Options
All
  • Public
  • Public/Protected
  • All
Menu

Shopify Cart Fetch

Index

Type aliases

Attributes: {}

Type declaration

  • [index: string]: string
CartEvents: "cart:requestStarted" | "cart:requestComplete" | "cart:ready"
CartItemAdd: { id: VariantID; properties?: LineItemProperties; quantity?: number }

Type declaration

CartItemIndex: number

The 1-based index position of the item in the cart.

CartItemPropertyID: VariantID | LineItemKey

The id value is the line item's variant_id or the line item's key.

CartItemRemove: { id: CartItemPropertyID } | { line: CartItemIndex }
CartItemUpdate: { properties?: LineItemProperties; quantity: number } & ({ line: CartItemIndex } | { id: CartItemPropertyID })
CartItems: CartItemAdd[] | CartItemAdd
CartItemsResponse: { items: CartLineItem[] }

Type declaration

CartLevelDiscountApplications: { allocation_method: string; created_at: string; description: string; key: string; target_selection: string; target_type: string; title: string; total_allocated_amount: number; type: string; value: string; value_type: string }

Type declaration

  • Readonly allocation_method: string
  • Readonly created_at: string
  • Readonly description: string
  • Readonly key: string
  • Readonly target_selection: string
  • Readonly target_type: string
  • Readonly title: string
  • Readonly total_allocated_amount: number
  • Readonly type: string
  • Readonly value: string
  • Readonly value_type: string
CartLineItem: { featured_image: FeaturedImage; final_line_price: number; final_price: number; gift_card: boolean; grams: number; handle: string; id: number; image: string; key: string; line_level_discount_allocations?: LineLevelDiscountAllocation[]; line_price: number; options_with_values: OptionsWithValues[]; price: number; product_description: string; product_has_only_default_variant: boolean; product_id: number; product_title: string; product_type: string; properties: LineItemProperties; quantity: number; requires_shipping: boolean; sku: string; taxable: boolean; title: string; url: string; variant_id: number; variant_options: string[]; variant_title: string; vendor: string }

Type declaration

  • Readonly featured_image: FeaturedImage
  • Readonly final_line_price: number
  • Readonly final_price: number
  • Readonly gift_card: boolean
  • Readonly grams: number
  • Readonly handle: string
  • Readonly id: number
  • Readonly image: string
  • Readonly key: string
  • Optional Readonly line_level_discount_allocations?: LineLevelDiscountAllocation[]
  • Readonly line_price: number
  • Readonly options_with_values: OptionsWithValues[]
  • Readonly price: number
  • Readonly product_description: string
  • Readonly product_has_only_default_variant: boolean
  • Readonly product_id: number
  • Readonly product_title: string
  • Readonly product_type: string
  • Readonly properties: LineItemProperties
  • Readonly quantity: number
  • Readonly requires_shipping: boolean
  • Readonly sku: string
  • Readonly taxable: boolean
  • Readonly title: string
  • Readonly url: string
  • Readonly variant_id: number
  • Readonly variant_options: string[]
  • Readonly variant_title: string
  • Readonly vendor: string
CartRoute: "/cart.js" | "/cart/add.js" | "/cart/update.js" | "/cart/change.js" | "/cart/clear.js" | "/cart/shipping_rates.json" | "/cart/prepare_shipping_rates.json" | "/cart/async_shipping_rates.json"

Shopify cart API routes

see

ShopifyAPI: cart

CartSettings: { postConfig?: RequestInit; updateState?: boolean; url?: string }

Type declaration

  • Optional Readonly postConfig?: RequestInit
  • Optional Readonly updateState?: boolean
  • Optional Readonly url?: string
CartState: { attributes: Attributes; cart_level_discount_applications: CartLevelDiscountApplications[]; currency: string; item_count: number; items: CartLineItem[]; items_subtotal_price: number; note: string; original_total_price: number; requires_shipping: boolean; token: string; total_discount: number; total_price: number; total_weight: number }

Type declaration

  • Readonly attributes: Attributes
  • Readonly cart_level_discount_applications: CartLevelDiscountApplications[]
  • Readonly currency: string
  • Readonly item_count: number
  • Readonly items: CartLineItem[]
  • Readonly items_subtotal_price: number
  • Readonly note: string
  • Readonly original_total_price: number
  • Readonly requires_shipping: boolean
  • Readonly token: string
  • Readonly total_discount: number
  • Readonly total_price: number
  • Readonly total_weight: number
DiscountApplication: { allocation_method: string; created_at: string; description: null; key: string; target_selection: string; target_type: string; title: string; total_allocated_amount: number; type: string; value: string; value_type: string }

Type declaration

  • allocation_method: string
  • created_at: string
  • description: null
  • key: string
  • target_selection: string
  • target_type: string
  • title: string
  • total_allocated_amount: number
  • type: string
  • value: string
  • value_type: string
FeaturedImage: { alt: string; aspect_ratio: number; url: string }

Type declaration

  • Readonly alt: string
  • Readonly aspect_ratio: number
  • Readonly url: string
LineItemKey: string

The line item's key.

see

ShopifyAPI: line_item.key

LineItemProperties: {}

An array of custom information for an item that has been added to the cart.

see

ShopifyAPI: line_item.properties

Type declaration

  • [index: string]: string
LineLevelDiscountAllocation: { amount: number; discount_application: DiscountApplication }

Type declaration

OptionsWithValues: { name: string; value: string }

Type declaration

  • Readonly name: string
  • Readonly value: string
VariantID: number | string

The id value is the line item's variant_id or the line item's key.

see

ShopifyAPI: variant_id

Generated using TypeDoc