Liquid Template Variables - cart
From Spiffy Stores Knowledge Base
The liquid template variable cart has the following attributes:
Contents
cart.item_count
Returns the number of items currently in the shopping cart.
For example:
{% if cart.item_count == 0 %}
Your shopping cart is empty!
{% else %}
You have <a href="/cart">{{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }}</a> in your cart
{% endif %}
cart.items
Returns all the items in the shopping cart. Each item is a LineItem.
For example:
<ul>
{% for item in cart.items %}
<li>{{ item.title }}</li>
{% endfor %}
</ul>