Skip to main content

Cart Items

This family renders the editable cart line-item list. CartItems owns the row loop. The atoms inside the default slot read the current row.

Components

Component keyRole
OmeWooCartItemsRenders cart rows and an authored empty slot.
OmeWooCartItemImageDisplays line product image.
OmeWooCartItemTitleDisplays product title or composed variant title.
OmeWooCartItemPriceDisplays unit price.
OmeWooCartItemSubtotalDisplays line subtotal.
OmeWooCartItemQuantityInteractive quantity input or display quantity.
OmeWooCartItemRemoveRemoves the current cart item.
OmeWooCartAttributeListLoops the selected variation attributes for the current line.
OmeWooCartAttributeNameDisplays attribute name inside CartAttributeList.
OmeWooCartAttributeValueDisplays attribute value inside CartAttributeList.

Authoring Structure

CartItems
default slot
CartItemImage
CartItemTitle
CartAttributeList
CartAttributeName
CartAttributeValue
CartItemPrice
CartItemQuantity
CartItemSubtotal
CartItemRemove
empty slot
authored empty-cart content

CartItems Props

PropMeaning
structure.root_tagRoot wrapper tag.
structure.item_tagRow tag.
structure.empty_tagEmpty state wrapper tag.
preview.rowsNumber of builder preview rows.
preview.empty_stateShows the empty slot in builder preview.

The runtime sets data-ome-state to has-items or empty.

Cart Item Atom Props

ComponentImportant props
CartItemImagecontent.alt_fallback is used when Woo image alt text is empty.
CartItemTitlecontent.include_attributes and content.variant_separator control composed variant title text.
CartItemQuantityconfiguration.mode is interactive or preview; content and accessibility props control label text.
CartItemRemovecontent.label and accessibility.aria_label control button text and accessible name.

CartItemPrice and CartItemSubtotal display Store API formatted price text from the current row.

Attribute Props

CartAttributeList exposes:

PropMeaning
structure.root_tagAttribute list wrapper tag.
structure.item_tagAttribute row tag.
preview.rowsNumber of builder preview attributes.

CartAttributeName and CartAttributeValue are row atoms; they need the current attribute row from CartAttributeList.

Hydration Rules

Server render uses CartItemAtomHydrator when current cart data exists. Runtime uses cart-items.ts after Store API responses. Both update:

  • Row keys and indexes.
  • Text fields.
  • Image attributes.
  • Quantity input values and cart item keys.
  • Remove button cart item keys.
  • Attribute rows cloned from the attribute row template.

Rows inside <template> elements are ignored until cloned.

Scenario Coverage

ScenarioCovered behavior
cart_items_dynamic_sourceEtch loop can render cartItems source directly.
cart_items_component_preview_contractCartItems renders seeded cart rows through cart item atoms.
cart_totals_taxed_cartQuantity updates and item removal refresh rows and totals.
cart_page_update_and_removeCart page row actions update state and empty slot.