9.2.2 Adding the Cart Summary; Listing 9-6 The Contents of the Summary.cshtml File

This commit is contained in:
Jason Zhu 2021-09-22 11:19:34 +10:00
parent d17ea37a0d
commit 57c4f167ca
2 changed files with 14 additions and 0 deletions

View File

@ -154,6 +154,7 @@
<Content Include="Views\Shared\ProductSummary.cshtml" />
<Content Include="Views\Nav\Menu.cshtml" />
<Content Include="Views\Cart\Index.cshtml" />
<Content Include="Views\Cart\Summary.cshtml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>

View File

@ -0,0 +1,13 @@
@model SportsStore.Domain.Entities.Cart
<div class="navbar-right">
@Html.ActionLink("Checkout", "Index", "Cart",
new { returnUrl = Request.Url.PathAndQuery },
new { @class = "btn btn-default navbar-btn" } )
</div>
<div class="navbar-text navbar-right">
<b>Your cart:</b>
@Model.Lines.Sum(x => x.Quantity) item(s),
@Model.ComputeTotalValue().ToString("c")
</div>