Renaming Cart to Basket (#38)
This commit is contained in:
@@ -7,13 +7,13 @@ using Microsoft.eShopWeb.ViewModels;
|
|||||||
namespace Microsoft.eShopWeb.Controllers
|
namespace Microsoft.eShopWeb.Controllers
|
||||||
{
|
{
|
||||||
[Route("[controller]/[action]")]
|
[Route("[controller]/[action]")]
|
||||||
public class CartController : Controller
|
public class BasketController : Controller
|
||||||
{
|
{
|
||||||
private readonly IBasketService _basketService;
|
private readonly IBasketService _basketService;
|
||||||
private const string _basketSessionKey = "basketId";
|
private const string _basketSessionKey = "basketId";
|
||||||
private readonly IUriComposer _uriComposer;
|
private readonly IUriComposer _uriComposer;
|
||||||
|
|
||||||
public CartController(IBasketService basketService,
|
public BasketController(IBasketService basketService,
|
||||||
IUriComposer uriComposer)
|
IUriComposer uriComposer)
|
||||||
{
|
{
|
||||||
_basketService = basketService;
|
_basketService = basketService;
|
||||||
@@ -28,9 +28,9 @@ namespace Microsoft.eShopWeb.Controllers
|
|||||||
return View(basketModel);
|
return View(basketModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST: /Cart/AddToCart
|
// POST: /Basket/AddToBasket
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> AddToCart(CatalogItemViewModel productDetails)
|
public async Task<IActionResult> AddToBasket(CatalogItemViewModel productDetails)
|
||||||
{
|
{
|
||||||
if (productDetails?.Id == null)
|
if (productDetails?.Id == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@using Microsoft.eShopWeb.ViewModels
|
@using Microsoft.eShopWeb.ViewModels
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Cart";
|
ViewData["Title"] = "Basket";
|
||||||
@model BasketViewModel
|
@model BasketViewModel
|
||||||
}
|
}
|
||||||
<section class="esh-catalog-hero">
|
<section class="esh-catalog-hero">
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="esh-catalog-items row">
|
<div class="esh-catalog-items row">
|
||||||
Cart is empty.
|
Basket is empty.
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
@model CatalogItemViewModel
|
@model CatalogItemViewModel
|
||||||
|
|
||||||
|
|
||||||
<form asp-controller="Cart" asp-action="AddToCart">
|
<form asp-controller="Basket" asp-action="AddToBasket">
|
||||||
|
|
||||||
<img class="esh-catalog-thumbnail" src="@Model.PictureUri" />
|
<img class="esh-catalog-thumbnail" src="@Model.PictureUri" />
|
||||||
<input class="esh-catalog-button" type="submit" value="[ ADD TO CART ]" />
|
<input class="esh-catalog-button" type="submit" value="[ ADD TO BASKET ]" />
|
||||||
|
|
||||||
<div class="esh-catalog-name">
|
<div class="esh-catalog-name">
|
||||||
<span>@Model.Name</span>
|
<span>@Model.Name</span>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
@await Html.PartialAsync("_LoginPartial")
|
@await Html.PartialAsync("_LoginPartial")
|
||||||
<section class="col-lg-1 col-xs-12"><a asp-controller="Cart" asp-action="Index">Cart</a></section>
|
<section class="col-lg-1 col-xs-12"><a asp-controller="Basket" asp-action="Index">Basket</a></section>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
@*<section class="col-lg-1 col-xs-12">
|
@*<section class="col-lg-1 col-xs-12">
|
||||||
@await Component.InvokeAsync("Cart", new { user = UserManager.Parse(User) })
|
@await Component.InvokeAsync("Basket", new { user = UserManager.Parse(User) })
|
||||||
</section>*@
|
</section>*@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user