예제 #1
0
        public virtual async Task <IHttpActionResult> GetWishList()
        {
            var viewModel = await WishListViewService.GetWishListViewModelAsync(new GetCartParam
            {
                Scope             = ComposerContext.Scope,
                CultureInfo       = ComposerContext.CultureInfo,
                CustomerId        = ComposerContext.CustomerId,
                CartName          = CartConfiguration.WishlistCartName,
                ExecuteWorkflow   = CartConfiguration.WishListExecuteWorkflow,
                WorkflowToExecute = CartConfiguration.WishListWorkflowToExecute,
                BaseUrl           = RequestUtils.GetBaseUrl(Request).ToString(),
                //WebsiteId = SiteConfiguration.GetWebsiteId()
            });

            return(Ok(viewModel));
        }
        public virtual ActionResult WishList(XhtmlDocument emptyWishListContent)
        {
            var vm = WishListViewService.GetWishListViewModelAsync(new GetCartParam
            {
                Scope             = ComposerContext.Scope,
                CultureInfo       = ComposerContext.CultureInfo,
                CustomerId        = ComposerContext.CustomerId,
                CartName          = CartConfiguration.WishlistCartName,
                ExecuteWorkflow   = CartConfiguration.WishListExecuteWorkflow,
                WorkflowToExecute = CartConfiguration.WishListWorkflowToExecute,
                BaseUrl           = RequestUtils.GetBaseUrl(Request).ToString()
            }).Result;

            if (vm != null && vm.TotalQuantity == 0 && emptyWishListContent != null)
            {
                return(View("WishListContainer", new { TotalQuantity = 0, EmptyContent = emptyWishListContent.Body }));
            }

            return(View("WishListContainer", vm));
        }