{% extends "base.html" %} {% block title %}Cart - LegalSnacks{% endblock %} {% block content %}

🛒 Your Loot

{% if cart_items %}
{% for item in cart_items %}

{{ item.product.name }}

{{ item.product.tagline }}

Quantity: {{ item.quantity }}

${{ "%.2f"|format(item.subtotal) }}

${{ "%.2f"|format(item.product.price) }} each

{% endfor %}

Total:

${{ "%.2f"|format(total) }}

{% if session.user_id %}
Your Balance: ${{ "%.2f"|format(user_balance) }}
{% if user_balance < total %}

⚠️ Insufficient balance! You need ${{ "%.2f"|format(total - user_balance) }} more.

{% endif %}
{% endif %}
{% if session.user_id %} {% if user_balance >= total %} Proceed to Checkout {% else %}

You need more funds to complete this order

{% endif %} {% else %} Login to Checkout {% endif %}
{% else %}

Your cart is empty. Time to fill it with delicious wrongdoing!

Browse Products
{% endif %}
{% endblock %}