public IActionResult OrderDetail() { var cart = PageMaster.GetShoppingCart(); cart.CartProducts = Repository.GetCartItems(cart); ViewBag.CountCartItems = cart.CartProducts.Count(); var model = new CheckOutModel { State = CheckOutState.OrderDetail, Cart = cart, TotalPrice = Repository.GetCartTotalPrice(cart), TotalQuantity = cart.CartProducts.Sum(p => p.Quantity) }; return(View(model)); }
public IActionResult CartDetail() { ShoppingCart cart = PageMaster.GetShoppingCart(); var model = new CartDetailModel() { Cart = cart, CartItems = Repository.GetCartItems(cart), CartTotalPrice = Repository.GetCartTotalPrice(cart) }; ViewBag.CountCartItems = cart.CartProducts.Count(); return(View(model)); }