-
Notifications
You must be signed in to change notification settings - Fork 5
/
_MiniCartDetails.cshtml
107 lines (101 loc) · 6.57 KB
/
_MiniCartDetails.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
@using EPiServer.Reference.Commerce.Site.Features.Shared.Extensions
@model EPiServer.Reference.Commerce.Site.Features.Cart.ViewModels.MiniCartViewModel
<div class="product-dropdown cart-dropdown product-row list-unstyled">
<input type="hidden" id="CartItemCount" value="@Model.ItemCount.ToString("0.####")" />
<input type="hidden" id="CartTotalAmount" value="@Model.Total.ToString()" />
<div class="cart-dropdown__product-container">
<ul class="list-unstyled">
@foreach (var shipment in Model.Shipments)
{
<li>
@{
if (Model.Shipments.Count() > 1)
{
Html.RenderPartial("_AddressSummaryLine", shipment.Address);
}
}
<ul class="list-unstyled">
@foreach (var cartItem in shipment.CartItems)
{
<li class="list-group-item product-item @cartItem.Code">
@using (Html.BeginForm("ChangeCartItem", "Cart", FormMethod.Post, new { data_container = "MiniCart" }))
{
@Html.Hidden("shipmentId", shipment.ShipmentId)
<div class="media">
<div class="media-left">
<a href="@cartItem.Url"><img src="@(cartItem.Entry.GetDefaultAsset<IContentImage>())" alt="@cartItem.DisplayName" class="media-object product-row__item__image" /></a>
</div>
<div class="media-body">
<div class="row">
<div class="col-md-10">
<a href="@cartItem.Url" class="link--black"><h4 class="product-row__item__title">@cartItem.DisplayName</h4></a>
</div>
<div class="col-md-2 text-right">
@if (!(bool)ViewData["IsReadOnly"] && !cartItem.IsGift)
{
<button role="button" class="btn btn-gray-lighter btn-xs jsRemoveCartItem"><i class="glyphicon glyphicon-remove"></i></button>
}
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>@Html.Translate("/ProductPage/Size")</strong>
@if ((bool)ViewData["IsReadOnly"] || cartItem.IsGift)
{
@Helpers.RenderSize(cartItem.Entry);
}
else
{
@Helpers.RenderSizeDropDown(cartItem);
}
</div>
<div class="col-md-3">
<strong>@Html.Translate("/Cart/Labels/Quantity")</strong>
@if ((bool)ViewData["IsReadOnly"] || cartItem.IsGift)
{
<input type="number" id="quantity" name="quantity" min="1" value="@cartItem.Quantity.ToString("0")" class="form-control cart-control form-quantity jsChangeCartItem" disabled="disabled" />
}
else
{
<input type="number" id="quantity" name="quantity" min="1" value="@cartItem.Quantity.ToString("0")" class="form-control cart-control form-quantity jsChangeCartItem" />
}
</div>
<div class="col-md-4 text-right product-col-price">
<h4 class="product-row__item__price product-price">@Helpers.RenderMoney(cartItem.DiscountedPrice.GetValueOrDefault())</h4>
</div>
</div>
</div>
@Html.Hidden("code", cartItem.Code)
@Html.Hidden("displayName", cartItem.DisplayName)
</div>
}
</li>
}
</ul>
</li>
}
</ul>
</div>
@if (Model.ItemCount > 0)
{
<div>
<ul class="list-unstyled cart-dropdown__button-list">
<li class="cart-item">
<button type="button" class="btn btn-block btn-primary" aria-expanded="false" onclick="window.location.href='@Url.ContentUrl(Model.CheckoutPage)'">@Html.Translate("/Header/MiniCart/Button/GoToCheckout")</button>
</li>
<li>
@using (Html.BeginForm("cartexpress", "vippsexpress", FormMethod.Get, new { @class = "vipps-express-form" }))
{
<button type="submit" role="button" class="btn-link btn-link-vipps" style="padding: 2px 0">
<img src="~/Styles/Images/vipps.png" alt="Vipps Hurtigkasse" class="vipps-express-img"/>
</button>
<p class="vipps-express-error" style="color: #d2691e"></p>
}
</li>
<li class="cart-item">
<button type="button" class="btn btn-block btn-default jsCartContinueShopping" aria-expanded="false">@Html.Translate("/Header/MiniCart/Button/Close")</button>
</li>
</ul>
</div>
}
</div>