public ActionResult AddToCart(int id) { var product = _productService.GetSingle(id); var cart = _cartSessionService.GetSession(); _cartService.AddToCart(cart, product); _cartSessionService.SetSession(cart); TempData.Add("message", string.Format("{0} was successfully added to cart", product.Name)); return(RedirectToAction("Index", "Home")); }
public ViewViewComponentResult Invoke() { return(View(_cartService.GetSession())); }