1

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.

1 Answer 1

1

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.

4
  • Thanks for the tip, I'll try it Monday morning and get back to you.
    – SlimDeluxe
    Aug 30, 2014 at 12:02
  • I finally got back to this task and yes this was all I needed :) Thank you
    – SlimDeluxe
    Sep 17, 2014 at 14:09
  • @OmerSabic i've got the same problem, i know it's not correct for the forum policy, but can you share your solution?
    – krybbio
    Sep 5, 2017 at 11:56
  • @krybbio sorry mate, this was 3 years ago at an agency where I do not work any more, so I don't have the source. Just check those classes and overload the correct methods, if you have some PHP experience you'll manage it.
    – SlimDeluxe
    Sep 5, 2017 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.