// TODO - Actually hook up the shopping cart with real product adds. private void AddProducts(ShoppingCart cart) { var products = new List<Product> { new Product { Name="Test Product", Description = "Test Product Description", Price = 1.25m, Type = ProductType.Gear} }; foreach (var product in products) { cart.Items.Add(new ShoppingCartItem { Product = product, Quantity = 2 }); } }
public IViewComponentResult Invoke() { var cart = new ShoppingCart() { Items = new List<ShoppingCartItem>() }; AddProducts(cart); // ReSharper disable once Mvc.ViewNotResolved return View(cart); }