How to Get All Layered Navigation Filters in Magento

adminfilterlayered-navigation

I have been looking a way to get all the layered navigation filters available, i dont know if this is per category or if i cant get all of them, because i need them on the admin side to choose in each category which ones i want to use, but currently i have been just able to get them in the front end when a category is selected by this line:

 $appliedFilters = Mage::getSingleton('Mage_Catalog_Block_Layer_State')->getActiveFilters();

Best Answer

If you simply want to get all attributes that are set as filterable via the admin section then you need to filter on the table catalog_eav_attribute where the column is_filterable is true:

/** @var Mage_Catalog_Model_Resource_Product_Attribute_Collection $attributeCollection */
$attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');
$attributeCollection->addFieldToFilter('is_filterable', true);
Related Topic