Route: /cart
Path Operation: cart_pageVariables#
| Variable | Type |
|---|
cart | Cart |
store | Store |
session | Session |
Cart Properties#
| Property | Description |
|---|
cart.products | Cart items |
cart.products_count | Item count |
cart.totals | Total lines |
cart.coupon | Applied coupon |
cart.gift_card_details | Gift card info |
cart.free_shipping_rule | Free shipping rule |
When adding a custom coupon section to cart.jinja, check the store.settings.checkout.is_coupon_form_enabled setting before rendering it.{% set coupon_form_enabled = store.settings.checkout.is_coupon_form_enabled != false %}
{% if coupon_form_enabled %}
{# Complete coupon section #}
{% endif %}
When the setting is false, do not render the coupon input, apply button, applied coupon details, remove button, or coupon-related messages.See Coupon Form Visibility for the complete implementation, JavaScript safeguards, testing steps, and troubleshooting guidance.Example#
{% extends "layout.jinja" %}
{% block main_content %}
{% if cart.products_count > 0 %}
<h1>{{ _("Cart") }}</h1>
{% include 'vitrin:cart/products_list.jinja' %}
<div class="totals">
{% for total in cart.totals %}
<div>{{ total.title }}: {{ total.value_string }}</div>
{% endfor %}
</div>
{% if session.is_guest %}
<a href="/auth/login?redirect_to=/checkout">{{ _("Complete Order") }}</a>
{% else %}
<a href="/checkout">{{ _("Complete Order") }}</a>
{% endif %}
{% else %}
<p>{{ _("Cart is empty") }}</p>
<a href="/">{{ _("Continue shopping") }}</a>
{% endif %}
{% endblock %}
Modified at 2026-08-04 09:55:23