Skip to main content
Returns the total number of items in the cart.

Parameters

None

Returns

number Returns 0 if the cart has not been initialized.

Examples

Display cart count

Update cart badge reactively

Check if cart has items

Header cart icon

This returns the total quantity of all items, not the number of unique line items. For example, 3 t-shirts + 2 hats = count of 5.