{% extends "base.html" %} {% block title %}Моя корзина{% endblock %} {% block content %}

Моя корзина

Продолжить покупки
{% if cart_items %}
{% for item in cart_items %} {% set item_total = item.price * item.quantity %} {% endfor %}
Товар Артикул Категория Материал Цена Количество Сумма Действия
{{ item.product_name }} {{ item.article }} {{ item.category_name }} {{ item.material_name or '-' }} {{ item.price|int }} руб.
{{ item_total|int }} руб.
Итого по заказу
{% set ns = namespace(subtotal=0) %} {% for item in cart_items %} {% set ns.subtotal = ns.subtotal + (item.price * item.quantity) %} {% endfor %} {% set assembly_percent = 15 %} {% set delivery_percent = 10 %} {% set assembly_amount = ns.subtotal * assembly_percent // 100 %} {% set delivery_amount = ns.subtotal * delivery_percent // 100 %} {% set total = ns.subtotal + assembly_amount + delivery_amount %}
Сумма без услуг:
{{ ns.subtotal|int }} руб.
Сборка ({{ assembly_percent }}%):
+{{ assembly_amount|int }} руб.
Доставка ({{ delivery_percent }}%):
+{{ delivery_amount|int }} руб.

ИТОГО:
{{ total|int }} руб.
{% else %}

Корзина пуста

Добавьте товары в корзину, чтобы оформить заказ

Перейти в каталог
{% endif %}
{% endblock %}