137 lines
7.2 KiB
Plaintext
137 lines
7.2 KiB
Plaintext
@using gehGassi.Web.Models
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@using gehGassi.Web.Auth
|
|
@using gehGassi.Web.Helper
|
|
@using Microsoft.AspNetCore.Mvc.Localization
|
|
@model gehGassi.Web.Models.CartListVm
|
|
|
|
@inject IViewLocalizer Localizer
|
|
@{
|
|
ViewData["Title"] = Localizer["Menu_Cart"];
|
|
}
|
|
|
|
<section id="cartOverviewContainer">
|
|
<div id="pageTitleAdd" style="display: none;"></div>
|
|
<div id="listoverview">
|
|
<div id="listContainer" class="form">
|
|
|
|
@await Html.PartialAsync("_CheckoutHeader", new CheckoutHeaderVm() { Step = 1 })
|
|
|
|
@if (Model.ItemCount == 0)
|
|
{
|
|
<h4 class="text-center">@Localizer["Cart_Empty"]</h4>
|
|
}
|
|
else
|
|
{
|
|
<h4 class="text-center">@string.Format(Localizer["Cart_Items"].Value, Model.ItemCount)</h4>
|
|
|
|
<div class="mb-2 mt-5">
|
|
@foreach (var cartItem in Model.CartItems)
|
|
{
|
|
var quantityInfo = "";
|
|
if (cartItem.Quantity >= cartItem.OrderMaximumQuantity)
|
|
{
|
|
quantityInfo = string.Format(Localizer["Cart_QuantityInfo"].Value, cartItem.OrderMaximumQuantity);
|
|
}
|
|
<div class="row mb-4">
|
|
<div class="col-4 col-md-3">
|
|
<img class="img-fluid mb-2" src="@GetImage(cartItem)" alt="@cartItem.ProductName" style="border: 1px solid #aaaaaa;"/>
|
|
</div>
|
|
<div class="col-8 col-md-9">
|
|
<div class="fw-bold">@cartItem.ProductSku @cartItem.ProductName</div>
|
|
@if (!string.IsNullOrWhiteSpace(cartItem.ProductSpecialInfo))
|
|
{
|
|
<div>@cartItem.ProductSpecialInfo</div>
|
|
}
|
|
<div><span class="text-primary fw-bold fs-5">€ @cartItem.TotalGross.ToString("N2")</span> <span class="cart-quantityInfo"> @quantityInfo</span></div>
|
|
<div class="p-1 mt-1 align-middle" style="white-space: nowrap;" data-itemid="@cartItem.Id" data-minquantity="@cartItem.OrderMinimumQuantity" data-maxquantity="@cartItem.OrderMaximumQuantity" data-quantity="@cartItem.Quantity">
|
|
<button type="button" class="btn btn-secondary btn-minus btn-sm" style="margin-top: -3px;"><i class="fa fa-minus"></i></button>
|
|
<input type="text" class="form-control form-control-sm d-inline-block text-center cart-item" value="@cartItem.Quantity" style="width: 50px;" readonly="readonly"/>
|
|
<button type="button" class="btn btn-secondary btn-plus btn-sm" style="margin-top: -3px;"><i class="fa fa-plus"></i></button>
|
|
<button type="button" class="btn btn-secondary btn-remove btn-sm" style="margin-top: -3px; margin-left: 15px;"><i class="fa fa-trash"></i></button>
|
|
@*@if (cartItem.ProductType == ProductTypeVm.Listing)
|
|
{
|
|
<button type="button" class="btn btn-secondary btn-edit btn-sm" style="margin-top: -3px; margin-left: 15px;"><i class="fa fa-pencil"></i></button>
|
|
}*@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
|
|
<div class="row mb-2">
|
|
<div class="col-12 col-md-6 offset-md-3">
|
|
<div class="table-cart-container bg-light">
|
|
<table class="table table-borderless table-cart">
|
|
<tr>
|
|
<td class="fw-bold">@Localizer["Cart_Subtotal"]:</td>
|
|
<td class="text-end">€ @Model.TotalGross.ToString("N2")</td>
|
|
</tr>
|
|
<tr>
|
|
<td>@Localizer["Cart_ShipmentCost"]:</td>
|
|
<td class="text-end">€ @Model.ShipmentGross.ToString("N2")</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"><hr/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">@Localizer["Cart_Total"]:</td>
|
|
<td class="text-end fw-bold">€ @((Model.TotalGross + Model.ShipmentGross).ToString("N2"))</td>
|
|
</tr>
|
|
@if (Model.TaxRates.Any())
|
|
{
|
|
foreach (var modelTaxRate in Model.TaxRates)
|
|
{
|
|
<tr>
|
|
<td>@Localizer["Cart_Tax"] @modelTaxRate.Key%:</td>
|
|
<td class="text-end">€ @modelTaxRate.Value.ToString("N2")</td>
|
|
</tr>
|
|
}
|
|
}
|
|
<tr>
|
|
<td colspan="2"><hr/></td>
|
|
</tr>
|
|
<tr>
|
|
<td>@Localizer["Common_BillingCountry"]:</td>
|
|
<td class="text-end">@Model.BillingCountryName</td>
|
|
</tr>
|
|
<tr>
|
|
<td>@Localizer["Common_DeliveryCountry"]:</td>
|
|
<td class="text-end">@Model.DeliveryCountryName</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="form-row button-row">
|
|
<div class="col-12">
|
|
<div class="">
|
|
<button type="button" id="btnClear" class="btn btn-primary"><i class="fa fa-fw fa-trash"></i> @Localizer["Button_Clear"]</button>
|
|
<button type="button" id="btnNext" class="btn btn-primary"><i class="fa fa-fw fa-cash-register"></i> @Localizer["Button_Checkout"]</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div id="detail" style="display: none;">
|
|
|
|
</div>
|
|
|
|
@Html.Hidden("jsRemoveItemFromCartUrl", Url.Action("RemoveItemFromCart", "Shop"))
|
|
@Html.Hidden("jsClearCartUrl", Url.Action("ClearCart", "Shop", new { customerUniqueId = User.CustomerUniqueId() }))
|
|
|
|
<system-js url="~/scripts/Views/Shop/cartOverview.js" fresh-import="true"></system-js>
|
|
|
|
</section>
|
|
|
|
@functions
|
|
{
|
|
string GetImage(CartItemListVm model)
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(model.ProductImage))
|
|
return $"/file/documents/thumbnails/200/{model.ProductImage}";
|
|
return "/images/product_generic_200.png";
|
|
}
|
|
} |