source: KernelRecordsMVC.Web/Views/Order/Cart.cshtml@ 08aefc6

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

Initial commit

  • Property mode set to 100644
File size: 4.0 KB
Line 
1@model KernelRecordsMVC.Application.ViewModels.CartViewModel
2
3<div class="d-flex justify-content-between align-items-center mb-4">
4
5 <h1>Your Cart</h1>
6
7 <a asp-controller="Release"
8 asp-action="Index"
9 class="btn btn-outline-primary">
10
11 Continue Shopping
12
13 </a>
14
15</div>
16
17
18@if (TempData["Error"] != null)
19{
20 <div class="alert alert-danger">
21
22 @TempData["Error"]
23
24 </div>
25}
26
27
28@if (!Model.Items.Any())
29{
30 <div class="text-center py-5">
31
32 <h3>Your cart is empty.</h3>
33
34 <p class="text-muted">
35 Browse our releases and add something to your order.
36 </p>
37
38 <a asp-controller="Release"
39 asp-action="Index"
40 class="btn btn-primary">
41
42 Browse Releases
43
44 </a>
45
46 </div>
47
48 return;
49}
50
51
52<div class="table-responsive">
53
54 <table class="table align-middle">
55
56 <thead>
57
58 <tr>
59
60 <th>Release</th>
61
62 <th>Format</th>
63
64 <th>Price</th>
65
66 <th>Quantity</th>
67
68 <th>Total</th>
69
70 <th></th>
71
72 </tr>
73
74 </thead>
75
76
77 <tbody>
78
79 @foreach (var item in Model.Items)
80 {
81 <tr>
82
83 <td>
84
85 <a asp-controller="Release"
86 asp-action="Details"
87 asp-route-id="@item.ReleaseId">
88
89 @item.ReleaseTitle
90
91 </a>
92
93 </td>
94
95
96 <td>
97
98 <span class="badge bg-secondary">
99
100 @item.Format
101
102 </span>
103
104 </td>
105
106
107 <td>
108
109 $@item.Price.ToString("0.00")
110
111 </td>
112
113
114 <td>
115
116 <form asp-action="UpdateQuantity"
117 method="post"
118 class="d-flex">
119
120 @Html.AntiForgeryToken()
121
122 <input type="hidden"
123 name="id"
124 value="@item.ProductId" />
125
126 <input type="number"
127 name="quantity"
128 value="@item.Quantity"
129 min="1"
130 max="@item.Stock"
131 class="form-control"
132 style="width:90px;" />
133
134 <button type="submit"
135 class="btn btn-outline-secondary ms-2">
136
137 Update
138
139 </button>
140
141 </form>
142
143 </td>
144
145
146 <td>
147
148 <strong>
149
150 $@item.Total.ToString("0.00")
151
152 </strong>
153
154 </td>
155
156
157 <td>
158
159 <form asp-action="RemoveProduct"
160 method="post">
161
162 @Html.AntiForgeryToken()
163
164 <input type="hidden"
165 name="id"
166 value="@item.ProductId" />
167
168 <button type="submit"
169 class="btn btn-outline-danger">
170
171 Remove
172
173 </button>
174
175 </form>
176
177 </td>
178
179 </tr>
180 }
181
182 </tbody>
183
184 </table>
185
186</div>
187
188
189<div class="row justify-content-end">
190
191 <div class="col-md-4">
192
193 <div class="card">
194
195 <div class="card-body">
196
197 <h4>Order Summary</h4>
198
199 <hr />
200
201 <div class="d-flex justify-content-between">
202
203 <span>Total</span>
204
205 <strong>
206 $@Model.Total.ToString("0.00")
207 </strong>
208
209 </div>
210
211
212 <a asp-action="Checkout"
213 class="btn btn-success w-100 mt-3">
214
215 Proceed to Checkout
216
217 </a>
218
219 </div>
220
221 </div>
222
223 </div>
224
225</div>
Note: See TracBrowser for help on using the repository browser.