I was able to find a decent solution that basically works. I post it here if anyone has a similar question.
The only disadvantages:
- Categories are not displayed in the tree structure (for now - are working on it)
- Clicking on the removal of a category filter maintains the category tree, as usual, except that it completely fits the root, which was unacceptable. My workaround was to force the X icon to completely remove the filter, rather than go to the parent category.
Details
The first step was to add a new attribute in the "special_type" category. This drop-down list allows administrators to choose whether the category will act as the main category (in my bullet list) or a special "collection".
The next step was to redefine the functionality inside Mage_Catalog_Model_Layer_Filter_Category :: _ getItemsData (), where $categories populated. If $this->getLayer()->getCurrentCategory()->getSpecialType() == is the default type, I call the original method ( return parent::_getItemsData() ). Otherwise...
I pass $this->getLayer()->getProductCollection() into a custom method that determines which standard categories will be displayed. I use the following filters in my query:
- Exclude custom categories
- Exclude the currently filtered category
- Show only top level categories
The last two basically allow this functionality: if I filter on tops now, show only child categories of Tops and nothing more.
The custom method returns a set of categories that match my criteria, and is assigned $categories . The rest of the method remains untouched.
Hope this helps someone in a similar situation.
source share