public ActionResult AchatComplet() { ShoppingCart cart = ShoppingCart.GetCart(this.HttpContext); ShoppingCartViewModel viewModel = new ShoppingCartViewModel { CartItems = cart.GetCartItems(), CartTotal = cart.GetTotal(), }; ViewBag.Total = cart.GetTotal(); //foreach (var c in cart.GetCartItems()) //{ // storeDB.Achat.Add(c); //} storeDB.SaveChanges(); return View(viewModel); }
public ActionResult Index() { ShoppingCart cart = ShoppingCart.GetCart(this.HttpContext); ShoppingCartViewModel viewModel = new ShoppingCartViewModel { CartItems = cart.GetCartItems(), CartTotal = cart.GetTotal(), }; ViewBag.Total = cart.GetTotal(); return View(viewModel); }