Pages are rendered server-side (SEO, no build step), the interactive parts talk to the existing REST API from the browser: - home: banners, categories, hits and new arrivals - catalog: filters (category, brand, price, stock), search, sorting, pagination, filter chips with one-click removal - product card: gallery, price with discount, stock, characteristics, related products - cart: localStorage, quantity controls, live totals - checkout: contacts, delivery, promo code, bonuses, order submission with Idempotency-Key, success screen - login: OTP by phone (debug code shown in dev) and phone/password - account: profile, orders, addresses, bonuses through the API with JWT - static pages from the admin Supporting pieces: - apps/storefront app with views, urls, templates and static CSS/JS - money/discount/attribute template filters - seed_demo management command with demo catalog, banners and pages - Cyrillic search fallback for SQLite: local DB does not fold case for non-ASCII, production PostgreSQL does Tests: 16 storefront cases (pages, filters, search, ordering, 404s, filters formatting); the suite is 61 passing.
35 lines
1.4 KiB
HTML
35 lines
1.4 KiB
HTML
{% extends "storefront/base.html" %}
|
||
{% load static storefront %}
|
||
|
||
{% block title %}Корзина — {{ site.site_name }}{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="page-head">
|
||
<h1>Корзина</h1>
|
||
</div>
|
||
|
||
<div class="cart-layout" data-cart-root>
|
||
<div>
|
||
<div class="cart-list" data-cart-list></div>
|
||
<div class="empty-state" data-cart-empty hidden>
|
||
<h2>Корзина пуста</h2>
|
||
<p>Добавьте товары из каталога — они сохранятся в этом браузере.</p>
|
||
<a class="btn btn-accent" href="{% url 'catalog' %}">Перейти в каталог</a>
|
||
</div>
|
||
</div>
|
||
|
||
<aside class="summary">
|
||
<h3>Итого</h3>
|
||
<div class="summary-row"><span>Товары</span><span data-subtotal>0 ₽</span></div>
|
||
<div class="summary-row"><span>Доставка</span><span data-delivery>рассчитаем при оформлении</span></div>
|
||
<div class="summary-row total"><span>К оплате</span><span data-total>0 ₽</span></div>
|
||
<a class="btn btn-accent btn-block" href="{% url 'checkout' %}" data-checkout-link>Оформить заказ</a>
|
||
<button class="btn btn-ghost btn-block" type="button" data-clear-cart>Очистить корзину</button>
|
||
</aside>
|
||
</div>
|
||
{% endblock %}
|
||
|
||
{% block scripts %}
|
||
<script src="{% static 'storefront/js/cart-page.js' %}" defer></script>
|
||
{% endblock %}
|