Liquid Template Variables - gift card

From Spiffy Stores Knowledge Base

Revision as of 09:44, 28 January 2022 by Admin (talk | contribs) (Created page with "The Liquid template variable '''gift_card''' has the following attributes: == <code>cart.item_count</code> == Returns the number of items currently in the shopping cart. Fo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Liquid template variable gift_card has the following attributes:

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 %} 

Further Reference