I have created a custom navigation module specifically for a website, but I really want to be able to list filterable attributes by a specific category. So for instance my main navigation is:
- Category 1
- Category 2
- Category 3 etc.
I then that when a user mouses over a category, they are then presented with an expanded menu with a few filterable options e.g.:
Category 1
View by manufacturer:
- Manufacturer 1
- Manufacturer 2
- Manufacturer 3 etc.
I am able to get all filterable attributes for the store, but I want this list to pull in only the filterable attributes per category, as for instance Category 1 may have different manufacturers to Category 2. I then need to cache these results as this will not change often.
The answer that Joe gave was a good starting point, but the attributes didn’t returned any options yet. After a lot of frustrations I solved the problem with the following code. Hope it helps all of you out.
The only thing you’ll need to do yourself is create the correct link using the getValue() functions.
This code has been tested in Magento 1.5