// GET: Checkout public ActionResult Checkout() { CheckoutViewModel vmCheckout = new CheckoutViewModel(); ShoppingCartActions cart = new ShoppingCartActions(); var cartItems = cart.getCartItems(); vmCheckout.shoppingCart = cartItems; vmCheckout.Grandtotal = cart.GetGrandTotal(); return(View(vmCheckout)); }
public JsonResult CalculateTotal() { ShoppingCartActions cart = new ShoppingCartActions(); var cartItems = cart.getCartItems(); List <decimal> total = new List <decimal>(); foreach (var c in cartItems) { total.Add(c.Quantity * c.Product.PRICE); } return(Json(total, JsonRequestBehavior.AllowGet)); }
// GET: ShoppingCart public ActionResult Cart() { ShoppingCartActions cart = new ShoppingCartActions(); //string ShoppingCartID = cart.GetCartId(); //var cartItems = (from c in db.SHOPPINGCART // where c.CartId==ShoppingCartID // join p in db.PRODUCTSETUP on c.ProductId equals p.ProductId // select new // { // c, // p.ProductName, // p.ProductImageUrl, // p.PRICE, // p.SIZE, // p.COLOR // }).ToList(); var cartItems = cart.getCartItems(); return(View(cartItems)); }