-
Notifications
You must be signed in to change notification settings - Fork 123
/
m2-p4-s6-render-totals
52 lines (47 loc) · 1.62 KB
/
m2-p4-s6-render-totals
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
{% extends 'store/main.html' %}
{% load static %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box-element">
<a class="btn btn-outline-dark" href="{% url 'store' %}">← Continue Shopping</a>
<br>
<br>
<table class="table">
<tr>
<th><h5>Items: <strong>{{order.get_cart_items}}</strong></h5></th>
<th><h5>Total:<strong> ${{order.get_cart_total|floatformat:2}}</strong></h5></th>
<th>
<a style="float:right; margin:5px;" class="btn btn-success" href="{% url 'checkout' %}">Checkout</a>
</th>
</tr>
</table>
</div>
<br>
<div class="box-element">
<div class="cart-row">
<div style="flex:2"></div>
<div style="flex:2"><strong>Item</strong></div>
<div style="flex:1"><strong>Price</strong></div>
<div style="flex:1"><strong>Quantity</strong></div>
<div style="flex:1"><strong>Total</strong></div>
</div>
{% for item in items %}
<div class="cart-row">
<div style="flex:2"><img class="row-image" src="{{item.product.imageURL}}"></div>
<div style="flex:2"><p>{{item.product.name}}</p></div>
<div style="flex:1"><p>${{item.product.price|floatformat:2}}</p></div>
<div style="flex:1">
<p class="quantity">{{item.quantity}}</p>
<div class="quantity">
<img class="chg-quantity" src="{% static 'images/arrow-up.png' %}">
<img class="chg-quantity" src="{% static 'images/arrow-down.png' %}">
</div>
</div>
<div style="flex:1"><p>${{item.get_total|floatformat:2}}</p></div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock content %}