Expand/Collapse Layered Navigation Categories

If your site has a lot of categories and/or sub-categories, your layered navigation “Shopping Options” block can get pretty large. An option is to make each category collapse or expand thereby saving valuable real estate on your page.

2. In your new copy, make the following changes (check that your dl class name is assigned – it’s referenced in the Jquery at the bottom)

3. While your template may be slightly different, the only changes you’ll make is to add an “href” to the <dt> section, adding the class name to the <dl> section and finally adding the <script> section at the bottom.

Here’s the complete view.phtml template (make sure you’re using the /layer/view.phtml as there are other templates with the same name (ie /product/view.phtml)

Magento Tips & Techniques

Magento is one of the leading E-Commerce platforms. The information provided in this site hopefully will help you with some "tweaks" to enhance the shopping experience or assist the administrator.

The posts are in no particular order but are added whenever I think of a tip, technique, code snippet or change that I think might be useful to the community.

I've only included 'hacks' that can be implemented by someone with a general Magento structure knowledge and basic php skills. More sophisticated Magento modifications are available from numerous sites and the Magento Knowledge base.