1.40 Bug: Specification filter control shows multiple headings insteading of grouping.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
I ran into a problem whereby the list of filter attributes was not being grouped correctly under the "Filter by Attributes" area of ProductSpecificationFilter.ascx.cs

I saw this:
Filter by Attributes
Color
  Black
Make
  Ferrari
Color
  White
Make
  Holden


instead of seeing:
Color
  Black
  White
Make
  Ferrari
  Holden


So either amend the sproc: [Nop_SpecificationAttributeOptionFilter_LoadByFilter] and orderby SpecificationAttributeName first then by DisplayOrder
or in code I did the following: (ProductSpecificationFilter.ascx.cs)

--------------------------------

        protected SpecificationAttributeOptionFilterCollection getNotFilteredSpecs()
        {
            //get all
            SpecificationAttributeOptionFilterCollection result = SpecificationAttributeManager.GetSpecificationAttributeOptionFilter(this.CategoryID);
          
            //remove already filtered
            SpecificationAttributeOptionFilterCollection alreadyFilteredOptions = getAlreadyFilteredSpecs();
            foreach (SpecificationAttributeOptionFilter saof1 in alreadyFilteredOptions)
            {
                var query = from s
                                in result
                            where s.SpecificationAttributeID == saof1.SpecificationAttributeID
                            select s;

                List<SpecificationAttributeOptionFilter> toRemove = query.ToList();

                foreach (SpecificationAttributeOptionFilter saof2 in toRemove)
                {
                    result.Remove(saof2);
                }
            }
      var sortedList = new SpecificationAttributeOptionFilterCollection();
      sortedList.AddRange(result.OrderBy(i => i.SpecificationAttributeName).ToList());
      return sortedList;
        }



--------------------------------

Unless of course this is by design
14 years ago
It's a bug that will be fixed in the next release
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.