source: KernelRecordsMVC.Web/Views/Order/Cart.cshtml@ d2eccb3

main
Last change on this file since d2eccb3 was fa0fbaf, checked in by mmilevski <markomilevski3@…>, 4 weeks ago

Added major improvements.

  • Property mode set to 100644
File size: 5.6 KB
Line 
1@model KernelRecordsMVC.Application.ViewModels.CartViewModel
2
3@{
4 ViewData["Title"] = "Cart";
5}
6
7<div class="cart-page">
8
9 <div class="cart-header">
10
11 <div>
12
13 <span class="page-eyebrow">
14 YOUR ORDER
15 </span>
16
17 <h1>Your Cart</h1>
18
19 <p>
20 Review your selected physical releases.
21 </p>
22
23 </div>
24
25 <a asp-controller="Release"
26 asp-action="Index"
27 class="store-button secondary">
28
29 Continue Shopping
30
31 </a>
32
33 </div>
34
35
36 @if (TempData["Error"] != null)
37 {
38 <div class="profile-alert"
39 style="background:#f9e8e8;color:#a33;">
40 @TempData["Error"]
41 </div>
42 }
43
44
45 @if (!Model.Items.Any())
46 {
47 <div class="empty-store">
48
49 <div class="empty-store-icon">
50 🛒
51 </div>
52
53 <h2>Your cart is empty</h2>
54
55 <p>
56 Browse our releases and add something to your order.
57 </p>
58
59 <a asp-controller="Release"
60 asp-action="Index"
61 class="store-button primary">
62
63 Browse Releases
64
65 </a>
66
67 </div>
68 }
69 else
70 {
71 <div class="cart-layout">
72
73 <div class="cart-items">
74
75 <div class="cart-items-header">
76 @Model.Items.Count item(s) in your cart
77 </div>
78
79
80 @foreach (var item in Model.Items)
81 {
82 <div class="cart-item">
83
84 <a asp-controller="Release"
85 asp-action="Details"
86 asp-route-id="@item.ReleaseId"
87 class="cart-item-cover">
88
89 @if (!string.IsNullOrWhiteSpace(item.CoverPhoto))
90 {
91 <img src="@item.CoverPhoto"
92 alt="@item.ReleaseTitle" />
93 }
94 else
95 {
96 <div class="cart-cover-placeholder">
97 ♪
98 </div>
99 }
100
101 </a>
102
103
104 <div class="cart-item-info">
105
106 <span class="cart-item-type">
107 @item.Format
108 </span>
109
110 <h2>
111
112 <a asp-controller="Release"
113 asp-action="Details"
114 asp-route-id="@item.ReleaseId">
115
116 @item.ReleaseTitle
117
118 </a>
119
120 </h2>
121
122 <div class="cart-item-price">
123
124 @item.Price.ToString("C")
125 each
126
127 </div>
128
129 </div>
130
131
132 <div class="cart-item-quantity">
133
134 <form asp-action="UpdateQuantity"
135 method="post">
136
137 @Html.AntiForgeryToken()
138
139 <input type="hidden"
140 name="id"
141 value="@item.ProductId" />
142
143 <input type="number"
144 name="quantity"
145 value="@item.Quantity"
146 min="1"
147 max="@item.Stock" />
148
149 <button type="submit">
150 Update
151 </button>
152
153 </form>
154
155 </div>
156
157
158 <div class="cart-item-total">
159
160 @item.Total.ToString("C")
161
162 </div>
163
164
165 <form asp-action="RemoveProduct"
166 method="post">
167
168 @Html.AntiForgeryToken()
169
170 <input type="hidden"
171 name="id"
172 value="@item.ProductId" />
173
174 <button type="submit"
175 class="cart-remove"
176 title="Remove">
177
178 ×
179
180 </button>
181
182 </form>
183
184 </div>
185 }
186
187 </div>
188
189
190 <aside class="cart-summary">
191
192 <span class="section-label">
193 ORDER SUMMARY
194 </span>
195
196 <h2>
197 Your Order
198 </h2>
199
200
201 <div class="summary-line">
202
203 <span>
204 Items
205 </span>
206
207 <strong>
208 @Model.Items.Sum(x => x.Quantity)
209 </strong>
210
211 </div>
212
213
214 <div class="summary-line total">
215
216 <span>
217 Total
218 </span>
219
220 <strong>
221 @Model.Total.ToString("C")
222 </strong>
223
224 </div>
225
226
227 <a asp-action="Checkout"
228 class="store-button primary full">
229
230 Proceed to Checkout
231
232 </a>
233
234 </aside>
235
236 </div>
237 }
238
239</div>
Note: See TracBrowser for help on using the repository browser.