Skip to main content

Cart State and Notices

This family renders global cart feedback: item count and cart notices. Both can be used outside a cart page.

When To Use This Family

Use CartCount and CartNotices anywhere cart actions need shared feedback: archive headers, product pages, cart pages, mini-carts, and checkout-adjacent layouts.

Quick Start

Shared cart feedback
Store header cart count:
<OmeWooCartCount />

<OmeWooCartNotices />

Components

Component keyRole
OmeWooCartCountDisplays the current cart item quantity and state.
OmeWooCartNoticesRenders Store API and Woo cart notices as safe text.

CartCount

CartCount subscribes to WooCartStore and displays cartSummary.item_count. It sets:

StateMeaning
emptyCart has no lines.
has-itemsCart has one or more lines.

It is useful in product archive headers, single product templates, mini-cart indicators, and cart pages.

CartNotices

CartNotices is a runtime notice region. It renders notices from cart actions:

SourceTypical action
add-to-cartProduct add failed.
quantityQuantity update failed.
removeRemove item failed.
couponApply or remove coupon failed.
shippingShipping rate selection failed.
stock or variationWoo Store API product constraints.

Messages are normalized and rendered as text, so Woo error content is not injected as HTML.

Props

ComponentPropMeaning
Cart noticespreview.show_in_builderShows a sample notice in Etch builder preview.
Cart noticespreview.notice_typePreview notice type: error, success, info, or warning.
Cart noticesaccessibility.aria_labelAccessible label for the notice region.
Cart noticesaccessibility.live_regionLive region politeness, defaulting to polite.

CartCount is mostly display and styling; its runtime content comes from the cart store.