Ejemplo n.º 1
0
        public MenuItem(ProductSearchRefinement refiner, List <KeyValuePair <string, string> > path) : this()
        {
            var notRoot        = path.Count > 1;
            var hasDescendants = refiner.Values.Any(x => x.Values.Any());

            Name = notRoot ? string.Format("Shop {0}", path.ElementAt(1).Key) : refiner.Label;

            foreach (var subSub in refiner.Values)
            {
                if (subSub.HitCount > 0 && (subSub.Values.Any() || !hasDescendants))
                {
                    Subs.Add(CreateMenuItem((subSub)));
                }
            }
        }
Ejemplo n.º 2
0
        public ExtendedFilterGrouping(ProductSearchRefinement refiner, ExtendedFilterGrouping selectedFilters) : this()
        {
            Label = refiner.Label.ToLowerInvariant();
            Note  = refiner.AttributeId;

            if (selectedFilters != null)
            {
                selectedFilters.Label = Label;
            }

            foreach (var value in refiner.Values)
            {
                if (value.HitCount > 0)
                {
                    FilterOptions.Add(new ExtendedFilterItem(value, selectedFilters));
                }
            }
        }