Cart
The cart object represents the current shopping cart in the store. It provides access to cart items, totals, discounts, shipping, and payment information.
Usage Example
{%- comment -%} Show cart summary and list items {%- endcomment -%}
<p>You have {{ cart.item_count }} items in your cart.</p>
<ul>
{% for item in cart.items %}
<li>
<strong>{{ item.product.title }}</strong> × {{ item.quantity }}<br>
Price: {{ item.line_price | money }}
</li>
{% endfor %}
</ul>
<p>Subtotal: {{ cart.subtotal | money }}</p>
<p>Shipping: {{ cart.shipping_price | money }}</p>
<p>Total: <strong>{{ cart.total | money_with_currency }}</strong></p>
{% if cart.applicable_for_free_shipping %}
<p>Congratulations! Your order qualifies for free shipping.</p>
{% elsif cart.calc_free_shipping_limit %}
<div class="free-shipping-info">
<strong>{{ cart.calc_free_shipping_limit.title }}</strong><br>
<span>{{ cart.calc_free_shipping_limit.description }}</span><br>
<span>Add {{ cart.calc_free_shipping_limit.amount_to_limit | money }} more (limit: {{ cart.calc_free_shipping_limit.limit_amount | money }}) for free shipping.</span>
</div>
{% endif %}Properties
id
Returns the unique identifier of the cart.
total
Returns the total price of the cart, including all items, shipping, and fees.
currency
Returns the currency code for this cart (e.g., EUR, USD).
subtotal
Returns the subtotal of the cart before shipping and fees.
payment_fee
Returns the total payment fees for this cart.
shipping_price
Returns the total shipping costs for this cart.
delivery_time_in_days
Returns the estimated delivery time in days for the cart.
payment_methods
Lists the selected payment methods for this cart.
shipping_methods
Lists the selected shipping methods for this cart.
discounts
Lists the applied discounts for this cart.
tax
Returns the total tax included in the cart.
tax_free
Returns the tax-free price of the cart.
weight_in_grams
Returns the total weight of the cart in grams.
item_count
Returns the total number of items in the cart.
items
Lists the items added to this cart.
expires
Returns the reservation expiration timestamp for this cart, if set.
applicable_for_free_shipping
Indicates if the current cart is eligible for free shipping.
calc_free_shipping_limit
Returns the free shipping limit for this cart, or false if not available.