Beispiel #1
0
        protected virtual void AddCommerceComponents(Customer.FoundationContact contact, CommerceHeaderViewModel viewModel)
        {
            if (_databaseMode.DatabaseMode == DatabaseMode.ReadOnly)
            {
                viewModel.MiniCart         = new MiniCartViewModel();
                viewModel.WishListMiniCart = new MiniWishlistViewModel();
                viewModel.SharedMiniCart   = new MiniCartViewModel();
                return;
            }

            viewModel.MiniCart = _cartViewModelFactory.CreateMiniCartViewModel(
                _cartService.LoadCart(_cartService.DefaultCartName, true)?.Cart);

            viewModel.WishListMiniCart = _cartViewModelFactory.CreateMiniWishListViewModel(
                _cartService.LoadCart(_cartService.DefaultWishListName, true)?.Cart);

            var organizationId = contact?.FoundationOrganization?.OrganizationId.ToString();

            if (!organizationId.IsNullOrEmpty())
            {
                viewModel.SharedMiniCart = _cartViewModelFactory.CreateMiniCartViewModel(
                    _cartService.LoadCart(_cartService.DefaultSharedCartName, organizationId, true)?.Cart, true);

                viewModel.ShowSharedCart = true;
            }
        }
Beispiel #2
0
        public ActionResult WishListMiniCartDetails()
        {
            var viewModel = _cartViewModelFactory.CreateMiniWishListViewModel(WishList.Cart);

            return(PartialView("_MiniWishList", viewModel));
        }