Magento – Layered Navigation with Multiple Attribute Choices

categorylayered-navigation

I'd like to make a simple "multiple choices per attribute" addon for the layered navigation.

Simply put, I want

/pisarniska-razsvetljava.html?led_color[]=3&led_color[]=4

to work. For this to happen, I need to

  1. convert attribute keys into IDs (e.g. led_color -> ID #2)
  2. alter the product collection load procedure to handle attribute value arrays and not just plain values

Because I can't see any of that happening in Mage/Catalog/CategoryController, where would I go or which class/method would I need to overload?

I found this repo https://github.com/mercator/catalin_seo which does what we want but it's very difficult to make any sense of it as the author overloads a ton of classes. I am hoping for a simpler solution.

Best Answer

You need to rewrite
app\code\core\Mage\Catalog\Model\Layer\Filter\Item.php
to generate right urls and
app\code\core\Mage\Catalog\Model\Layer\Filter\Attribute.php
plus
app\code\core\Mage\Catalog\Model\Resource\Layer\Filter\Attribute.php to accept multiple values filter.

As well as app\code\core\Mage\Catalog\Block\Layer\State.php to show the selection.

Make sure it will work with the search, as it uses different layer collection.

Related Topic