protected override bool Execute(T ruleContext) { SiteContext shopContext = Context.Site; Sitecore.Diagnostics.Assert.IsNotNull(shopContext, "Context site cannot be null."); var userId = this.GetCurrentUserId(); var cartList = CartService.GetCarts(new GetCartsRequest(shopContext.Name) { UserIds = new string[] { userId } }).Carts .Select(cartBase => CartService .LoadCart(new LoadCartRequest(shopContext.Name, cartBase.ExternalId, userId)).Cart as CommerceCart); if (cartList == null) { return(false); } bool found = CartEvaluationLogic(cartList); return(found); }