public ActionResult ToggleShipment(string storeItemCartId, string merchantId, string cartId) { try { StoreGateway sg = new StoreGateway(); bool success = sg.ToggleShipment(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; decimal price = 0.0M; decimal shippingTemp = 0.0M; if (store != null) { itemTotals = store.TotalPrice; itemShipping = store.TotalShipping; totalAfterShipping = store.TotalAfterShipping; var item = store.StoreItems.Where(x => x.ShoppingCartItemId == Convert.ToInt32(storeItemCartId)).FirstOrDefault(); price = item.Price; shippingTemp = item.Shipping; } return Json(new { IsSuccessful = true, itemPrice = "$" + price.ToString("N2") + " + $" + shippingTemp.ToString("N2"), 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); }