Cleaning things up and getting add item to cart working for anonymous or authenticated users.
This commit is contained in:
32
src/Web/Views/Cart/Index.cshtml
Normal file
32
src/Web/Views/Cart/Index.cshtml
Normal file
@@ -0,0 +1,32 @@
|
||||
@using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
@{
|
||||
ViewData["Title"] = "Catalog";
|
||||
@model Basket
|
||||
}
|
||||
<section class="esh-catalog-hero">
|
||||
<div class="container">
|
||||
<img class="esh-catalog-title" src="../images/main_banner_text.png" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="container">
|
||||
|
||||
@if (Model.Items.Any())
|
||||
{
|
||||
<div class="esh-catalog-items row">
|
||||
@foreach (var item in Model.Items)
|
||||
{
|
||||
<div class="esh-catalog-item col-md-4">
|
||||
@item.ProductId
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="esh-catalog-items row">
|
||||
Cart is empty.
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
<form asp-controller="Cart" asp-action="AddToCart">
|
||||
|
||||
<img class="esh-catalog-thumbnail" src="@Model.PictureUri" />
|
||||
<input class="esh-catalog-button @((!User.Identity.IsAuthenticated) ? "is-disabled" : "")" type="submit" value="[ ADD TO CART ]" />
|
||||
<input class="esh-catalog-button" type="submit" value="[ ADD TO CART ]" />
|
||||
|
||||
<div class="esh-catalog-name">
|
||||
<span>@Model.Name</span>
|
||||
|
||||
Reference in New Issue
Block a user