public ActionResult AddToCart(int id, int amount) { Product p = productFactory.Get(id); cart.Add(p); return(Redirect(Request.UrlReferrer.ToString())); }
public ActionResult AddToCart(int id, int amount) { ProductVM vm = new ProductVM(); vm.Product = productFac.Get(id); vm.Images = imageFac.GetBy("ProductID", id); vm.Category = categoryFac.Get(vm.Product.CategoryID); for (int i = 0; i < amount; i++) { cart.Add(vm); } return(Redirect(Request.UrlReferrer.ToString())); }