Files

43 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<%- include('partials/layout-start') %>
<h1>Заказ #<%= order.id %></h1>
<% if (success) { %>
<p class="alert alert--success">Заказ успешно оформлен! Мы свяжемся с вами по email.</p>
<% } %>
<div class="card order-card">
<% const statusLabels = { pending: 'Ожидает обработки', paid: 'Оплачен', shipped: 'Отправлен', cancelled: 'Отменён' }; %>
<p><strong>Статус:</strong> <span class="status status--<%= order.status %>"><%= statusLabels[order.status] || order.status %></span></p>
<p><strong>Дата:</strong> <%= new Date(order.created_at).toLocaleString('ru-RU') %></p>
<p><strong>Доставка:</strong> <%= order.address %></p>
<p><strong>Контакт:</strong> <%= order.customer_name %>, <%= order.customer_email %><% if (order.customer_phone) { %>, <%= order.customer_phone %><% } %></p>
<h2>Состав заказа</h2>
<ul class="checkout-list">
<% items.forEach(item => { %>
<li>
<span><a href="/product/<%= item.slug %>"><%= item.name %></a> × <%= item.quantity %></span>
<span><%= formatPrice(item.price_cents * item.quantity) %></span>
</li>
<% }) %>
</ul>
<% const subtotal = order.subtotal_cents != null ? order.subtotal_cents : order.total_cents; %>
<% if (order.discount_cents > 0) { %>
<dl class="cart-summary__dl">
<dt>Товары</dt>
<dd><%= formatPrice(subtotal) %></dd>
<dt>Скидка</dt>
<dd class="cart-summary__discount"><%= formatPrice(order.discount_cents) %></dd>
</dl>
<% } %>
<% if (order.loyalty_points_earned > 0) { %>
<p class="muted">Начислено баллов лояльности: +<%= order.loyalty_points_earned %></p>
<% } %>
<p class="checkout-total">К оплате: <strong><%= formatPrice(order.total_cents) %></strong></p>
</div>
<p><a href="/orders" class="link-back">← Все заказы</a></p>
<%- include('partials/layout-end') %>