@page @model CheckoutModel @{ ViewData["Title"] = "Checkout"; } <section class="esh-catalog-hero"> <div class="container"> <img class="esh-catalog-title" src="~/images/main_banner_text.png" /> </div> </section> <div class="container"> <h1>Review</h1> @if (Model.BasketModel.Items.Any()) { <form asp-page="Checkout" method="post"> <article class="esh-basket-titles row"> <br /> <section class="esh-basket-title col-xs-3">Product</section> <section class="esh-basket-title col-xs-3 hidden-lg-down"></section> <section class="esh-basket-title col-xs-2">Price</section> <section class="esh-basket-title col-xs-2">Quantity</section> <section class="esh-basket-title col-xs-2">Cost</section> </article> <div class="esh-catalog-items row"> <div asp-validation-summary="All" class="text-danger"></div> @for (int i = 0; i < Model.BasketModel.Items.Count; i++) { var item = Model.BasketModel.Items[i]; <article class="esh-basket-items row"> <div> <section class="esh-basket-item esh-basket-item--middle col-lg-3 hidden-lg-down"> <img class="esh-basket-image" src="@item.PictureUrl" /> </section> <section class="esh-basket-item esh-basket-item--middle col-xs-3">@item.ProductName</section> <section class="esh-basket-item esh-basket-item--middle col-xs-2">$ @item.UnitPrice.ToString("N2")</section> <section class="esh-basket-item esh-basket-item--middle col-xs-2"> <input type="hidden" name="@("Items[" + i + "].Id")" value="@item.Id" /> <input type="hidden" name="@("Items[" + i + "].Quantity")" value="@item.Quantity" /> @item.Quantity </section> <section class="esh-basket-item esh-basket-item--middle esh-basket-item--mark col-xs-2">$ @Math.Round(item.Quantity * item.UnitPrice, 2).ToString("N2")</section> </div> <div class="row"> </div> </article> } <div class="container"> <article class="esh-basket-titles esh-basket-titles--clean row"> <section class="esh-basket-title col-xs-10"></section> <section class="esh-basket-title col-xs-2">Total</section> </article> <article class="esh-basket-items row"> <section class="esh-basket-item col-xs-10"></section> <section class="esh-basket-item esh-basket-item--mark col-xs-2">$ @Model.BasketModel.Total().ToString("N2")</section> </article> <article class="esh-basket-items row"> <section class="esh-basket-item col-xs-7"></section> </article> </div> <div class="row"> <section class="esh-basket-item col-xs-1"> <a asp-page="Index" class="btn esh-basket-checkout text-white">[ Back ]</a> </section> <section class="esh-basket-item col-xs-push-7 col-xs-4 text-right"> <input type="submit" class="btn esh-basket-checkout" value="[ Pay Now ]" /> </section> </div> </div> </form> } else { <h3 class="esh-catalog-items row"> Basket is empty. </h3> <section class="esh-basket-item"> <a asp-page="/Index" class="btn esh-basket-checkout text-white">[ Continue Shopping..]</a> </section> } </div>