Cart Variables

Variable Usage
cart.getDiscountTotal() Returns the total discount amount for cart items.
Discount: {{ cart.getDiscountTotal()|currency }}<br>
cart.getItemNum() Returns the number of items in the cart.
<h5>You currently have <strong>{{ cart.getItemNum() }}</strong> item(s) in your cart</h5><br>
cart.getSubtotal() Returns the subtotal for cart items.
Cart total: {{ cart.getSubtotal()|currency }}<br>
cart.getSubtotalNoTax() Returns the subtotal for cart items minus tax.
Estimated subtotal: {{ cart.getSubtotalNoTax()|currency }}<br>
cart.getTotal() Returns the total for cart items.
Estimated total: {{ cart.getTotal()|currency }}<br>
cart.getTotalTax() Returns the total amount of tax for cart items.
Tax Total: {{ cart.getTotalTax()|currency }}<br>
cart.getCustomFieldsArray() Returns array of key/value pairs from configured custom fields.
{{ cart.getCustomFieldsArray() }}
cart.hasItems() Returns true if a cart has items.
{% if cart.hasItems() %}
    {# Do a thing if a cart has items #}
{% endif %}
items A collection of items for in the cart.
{% for item in items%}
  {# ... render item fields #}
  Item Name: {{ }}
{% endfor %}
totals An object that contains checkout totals.
{# Render total details... #}
{{ totals.discountTotal | currency }}
{{ totals.subtotal | currency }}
{{ totals.totalSalesTax | currency }}
{{ totals.totalShippingQuote | currency }}
{{ totals.totalShippingTax | currency }}
{{ | currency }}
Item Variable Attributes
item.fullPrice() Returns the full price of the cart item.
<td class="narrow"><i>{{ item.fullPrice()|currency }}</i></td><br>
item.price() Returns the current price of the cart item after discounts.
<td class="narrow"><i>{{ item.price()|currency }}</i></td><br>
item.product.images.first.thumbnail() Returns the first image associated with the cart item. Allows for the setting of image dimensions via .thumbnail(width,height). A default image can also be set in the event that no image has been uploaded for the product.
<img src="{{ item.product.images.first.thumbnail(80, 80)|default('') }}"/></a><br> Returns the name for the cart item.
<h3><a href="/product/{{ item.product.url_name }}">{{ }}</a></h3><br>
item.product.url_name Returns the product URL name for the cart item.
<a class="hide-for-small" href="/product/{{ item.product.url_name }}"><br>
item.quantity Returns the quantity of items added to the cart.
<td class="narrow">{{ item.quantity }}</td><br> Returns the total price for the cart items.
<td class="narrow"><i>{{|currency }}</i></td><br>