示例#1
0
        public MiniCartBaseJsonResult UpdateMiniCart(bool updateCart)
        {
            var response = _cartManager.GetCurrentCart(CurrentStorefront, CurrentVisitorContext, updateCart);
            var result   = new MiniCartBaseJsonResult(response.ServiceProviderResult);

            if (response.ServiceProviderResult.Success && response.Result != null)
            {
                result.Initialize(response.ServiceProviderResult.Cart);
            }

            return(result);
        }
示例#2
0
        public JsonResult UpdateMiniCart(bool updateCart = false)
        {
            try
            {
                var response = this.CartManager.GetCurrentCart(CurrentStorefront, CurrentVisitorContext, updateCart);
                var result   = new MiniCartBaseJsonResult(response.ServiceProviderResult);
                if (response.ServiceProviderResult.Success && response.Result != null)
                {
                    result.Initialize(response.ServiceProviderResult.Cart);
                }

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                CommerceLog.Current.Error("UpdateMiniCart", this, e);
                return(Json(new BaseJsonResult("UpdateMiniCart", e), JsonRequestBehavior.AllowGet));
            }
        }