public ActionResult DeleteItemFromCart(string storeItemCartId, string merchantId, string cartId) { try { StoreGateway sg = new StoreGateway(); bool success = sg.DeleteItemFromCart(Convert.ToInt32(storeItemCartId), new Guid(cartId)); StoreShoppingCart cart = sg.GetShoppingCart(new Guid(cartId)); var store = cart.Stores.Where(x => x.MerchantId == new Guid(merchantId)).FirstOrDefault(); decimal itemTotals = 0.0M; decimal itemShipping = 0.0M; decimal totalAfterShipping = 0.0M; if (store != null) { itemTotals = store.TotalPrice; itemShipping = store.TotalShipping; totalAfterShipping = store.TotalAfterShipping; } this.AddItemToCart(HttpContext.Session, -1); return Json(new { IsSuccessful = true, subtotal = "$" + itemTotals.ToString("N2"), shipping = "$" + itemShipping.ToString("N2"), afterShipping = "$" + totalAfterShipping.ToString("N2") }, JsonRequestBehavior.AllowGet); } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return Json(new { IsSuccessful = false }, JsonRequestBehavior.AllowGet); }