-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_CheckoutCart.cshtml
83 lines (83 loc) · 3.68 KB
/
_CheckoutCart.cshtml
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
@model CartViewModel
<h4 class="d-flex justify-content-between align-items-center mb-3">
<span class="text-muted">Your cart</span>
<span class="badge badge-secondary badge-pill">@Model.CartItems.Sum(x=>x.CartItemUnits)</span>
</h4>
<ul class="list-group mb-3" id="checkout-items">
@foreach (var cartItem in Model.CartItems)
{
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">@cartItem.SKUName</h6>
<small class="text-muted font-italic">
@cartItem.SKUNumber
@Html.Raw(!string.IsNullOrEmpty(cartItem.SKUNumber)? "<br/>" : "")
@if (cartItem.CustomOptions.Count > 0)
{
foreach (var key in cartItem.CustomOptions.Keys)
{
<strong>@key :</strong> @cartItem.CustomOptions[key]
<br/>
}
}
<strong>quantity:</strong> @cartItem.CartItemUnits
</small>
</div>
<span class="text-muted">@cartItem.FormattedPrice</span>
</li>
}
@foreach (var discount in Model.AppliedItemDiscounts)
{
<li class="list-group-item d-flex justify-content-between bg-light align-items-center">
<div class="text-success mr-auto">
<h6 class="my-0 coupon">@discount.Key</h6>
</div>
<span class="text-success pr-2">-@Model.FormatPrice(discount.Value)</span>
@if (Model.CouponCodes.Contains(discount.Key, StringComparer.InvariantCultureIgnoreCase)) {
<button type="submit" class="btn btn-sm btn-secondary remove-coupon">remove</button>
}
</li>
}
@if (Model.SubTotal != Model.GrandTotal)
{
<li class="list-group-item d-flex justify-content-between">
<span>Sub Total</span>
<strong>@Model.FormatPrice(Model.SubTotal)</strong>
</li>
}
@if (Model.TotalShipping > 0 || Model.IsShippingNeeded)
{
<li class="list-group-item d-flex justify-content-between">
<span @Html.Raw(Model.TotalShipping == 0 ? "class=\"text-success\"" : "")>Shipping</span>
<strong @Html.Raw(Model.TotalShipping == 0 ? "class=\"text-success\"" : "")>@Model.FormatPrice(Model.TotalShipping)</strong>
</li>
if (Model.RemainingAmountForFreeShipping > 0)
{
<li class="list-group-item d-flex justify-content-between">
<small class="font-italic">Amount Till Free Shipping</small>
<small><strong class="font-italic">@Model.FormatPrice(Model.RemainingAmountForFreeShipping)</strong></small>
</li>
}
}
@if (Model.TotalTax > 0)
{
<li class="list-group-item d-flex justify-content-between">
<span>Tax</span>
<strong>@Model.FormatPrice(Model.TotalTax)</strong>
</li>
}
@foreach (var discount in Model.AppliedOrderDiscounts)
{
<li class="list-group-item d-flex justify-content-between bg-light align-items-center">
<div class="text-success mr-auto">
<h6 class="my-0 coupon">@discount.Key</h6>
</div>
<span class="text-success pr-2">-@Model.FormatPrice(discount.Value)</span>
<button type="submit" class="btn btn-sm btn-secondary remove-coupon">remove</button>
</li>
}
<li class="list-group-item d-flex justify-content-between">
<span>Total (@CMS.Ecommerce.ECommerceContext.CurrentCurrency.CurrencyCode)</span>
<strong>@Model.FormatPrice(Model.GrandTotal)</strong>
</li>
</ul>