This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
/
view.html
91 lines (91 loc) · 3.82 KB
/
view.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% extends 'satchless/cart/base.html' %}
{% load i18n promote prices product_prices cart_prices %}
{% block title %}{% trans "My cart" %}{% endblock %}
{% block breadcrumbs %}
{{ block.super }}
<li><a href="">{% trans "My cart" %}</a></li>
{% endblock %}
{% block content %}
<h1>{% trans "My cart" %}</h1>
{% csrf_token %}
<table class="cart">
<thead>
<tr>
<th>{% trans "No." %}</th>
<th>{% trans "Item" %}</th>
<th>{% trans "Unit price" %}</th>
<th>{% trans "Quantity" %}</th>
<th>{% trans "Price" %}</th>
<th>{% trans "Tax" %}</th>
<th>{% trans "Delete" %}</th>
</tr>
</thead>
<tbody>
{% for form in cart_item_forms %}
{% if form.quantity.errors %}
<tr class="errors">
<td></td>
<td colspan="5">
{{ form.quantity.errors }}
</td>
<td></td>
</tr>
{% endif %}
{% cartitem_unit_price form.instance pricing_handler as unit_price %}
{% cartitem_price form.instance pricing_handler as item_price %}
<tr class="item">
<td rowspan="2">{{ forloop.counter }}</td>
<td rowspan="2">{% promote form.instance.variant as variant %}
<a href="{{ variant.product.get_absolute_url }}">{{ variant }}</a>
</td>
<td class="numerical unitPrice">
{{ unit_price|gross|floatformat:2 }} <span class="currency">{{ cart.currency }}</span><br />
</td>
<td class="numerical quantity">
<form method="POST" action="">
{% csrf_token %}
× {{ form.quantity }}
<button type="submit">{% trans "Update" %}</button>
</form>
</td>
<td class="numerical itemPrice">
= {{ item_price|gross|floatformat:2 }} <span class="currency">{{ cart.currency }}</span><br />
</td>
<td class="numerical tax">
{{ item_price|tax|floatformat:2 }} <span class="currency">{{ cart.currency }}</span>
</td>
<td rowspan="2">
<form method="POST" action="{% url cart:remove-item form.instance.id %}">
{% csrf_token %}
<button type="submit">{% trans "Delete" %}</button>
</form>
</td>
</tr>
<tr>
<td class="numerical unitPrice netPrice">
{{ unit_price|net|floatformat:2 }} <span class="currency">{{ cart.currency }}</span>
</td>
<td></td>
<td class="numerical itemPrice netPrice">
{{ item_price|net|floatformat:2 }} <span class="currency">{{ cart.currency }}</span>
</td>
<td class="numerical taxName">
{% with item_price|tax_name as taxname %}{% if taxname %}({{ taxname }}){% endif %}{% endwith %}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr class="total">
<th colspan="4" rowspan="2">{% trans "Total" %}:</th>
<td class="numerical">
{{ cart.get_total|gross|floatformat:2 }} <span class="currency">{{ cart.currency }}</span><br />
</td>
<td colspan="2" rowspan="2"></td>
</tr>
<tr>
<td class="numerical netPrice">{{ cart.get_total|net|floatformat:2 }} <span class="currency">{{ cart.currency }}</span></td>
</tr>
</tfoot>
</table>
{% endblock %}