public ActionResult CartTotal(ShoppingCart cart) { if(cart == null) cart = new ShoppingCart(); return PartialView("CartTotal", cart); }
private ShoppingCart GetCurrentCart() { var cart = (ShoppingCart)Session["cart"]; if(cart == null) { Session["cart"] = cart = new ShoppingCart(); } return cart; }