How can I group the options of an attribute alphabetically in layered navigation frontend?

I have approx 300 options for an attribute and I need to group them, such as [A-C] [D-F], etc.

The idea is that clicking on [A-C] the users see all the options from A to C of that attribute, and so on.


Checkout "frontend/rwd/default/template/catalog/layer/filter.phtml" - it shows those options for you. Edit this file so that (for your special attribute) it renders multiple ordered lists with some type of heading between them, those headings being 'A-D' etc.

Now you need to put some javascript in there. Again, depending on what you have (jquery or plain prototype) there are different ways to do this. Essentially what you want to do is toggle one of the letter groups on whilst toggling off the rest. When you do this the next siblings (containing the ordered list) need to be shown/hidden accordingly.

This is a general approach, if you need more details let me know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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