Add old price property for the basket in the WebMVC

This commit is contained in:
dsanz 2017-03-13 12:15:41 +01:00
parent 6617981303
commit 4e5e32c6aa
2 changed files with 19 additions and 11 deletions

View File

@ -11,6 +11,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
public string ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; }
public string PictureUrl { get; set; }
}

View File

@ -18,7 +18,7 @@
var item = Model.Items[i];
<article class="esh-basket-items esh-basket-items--border 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>
@ -29,6 +29,13 @@
<input type="number" class="esh-basket-input" min="1" name="@("quantities[" + i +"].Value")" value="@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)</section>
</div>
@if (item.OldUnitPrice != 0)
{
<div class="esh-basket-item">
The price of the item has changed. Old price was @item.OldUnitPrice $
</div>
}
</article>
}
</div>