-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetails-cart.html
More file actions
72 lines (65 loc) · 2.78 KB
/
Copy pathdetails-cart.html
File metadata and controls
72 lines (65 loc) · 2.78 KB
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
<!DOCTYPE html>
<html lang="en"
xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="~{/fragments/head}"></th:block>
</head>
<body>
<header>
<th:block th:include="~{/fragments/navbar}"></th:block>
</header>
<main class="mt-3">
<h1 class="text-center text-dark">Корзина</h1>
<hr class="hr-2 bg-dark w-75">
<table class="table table-hover w-75 mx-auto">
<thead class="thead-light">
<tr class="row mx-auto">
<th class="col-md-2 text-center">Изображения</th>
<th class="col-md-3 text-center">Наименования</th>
<th class="col-md-2 text-center">Характеристики</th>
<th class="col-md-2 text-center">Цена</th>
<th class="col-md-1 text-center">Количество</th>
<th class="col-md-2 text-center">Действия</th>
</tr>
</thead>
<tbody>
<th:block th:each="item : ${#session.getAttribute('shopping-cart')}" th:object="${item}">
<tr class="row mx-auto">
<th class="col-md-2 text-center"><img th:src="*{product.imageUrl}" alt="Product" height="150"></th>
<td class="col-md-3 text-center" th:text="*{product.name}"></td>
<td class="col-md-2 text-center" th:text="*{product.description}"></td>
<td class="col-md-2 text-center" style="color: green" th:text="|*{product.price} $|"></td>
<td class="col-md-1 text-center" th:text="*{quantity}"></td>
<td class="col-md-2 text-center">
<form th:action="@{/cart/remove-product}" th:method="delete">
<div class="button-holder d-flex justify-content-center">
<button type="submit" class="btn btn-danger">Удалить из корзины</button>
<input type="hidden" name="id" th:value="*{product.id}">
</div>
</form>
</td>
</tr>
</th:block>
</tbody>
</table>
<hr class="hr-2 bg-dark">
<div class="text-center">
<h3 style="color: red" th:text="${emptyList}"></h3>
</div>
<div class="text-center">
<h3 style="color: red" th:text="${notEnoughMoneyMessage}"></h3>
</div>
<div class="text-center">
<h3 style="color: green" th:text="|Итоговая сумма: ${totalPrice} $|"></h3>
</div>
<form th:action="@{/cart/checkout-cart}" th:method="post">
<div class="button-holder d-flex justify-content-center mt-4">
<button type="submit" class="btn btn-success">Оплатить</button>
</div>
</form>
</main>
<footer>
<th:block th:include="~{/fragments/footer}"></th:block>
</footer>
</body>
</html>