using below code i can able to get all filterable attributes for a category,
$json = array();
$layer = Mage::getModel("catalog/layer");
$category = Mage::getModel("catalog/category")->load(3); // Jeaan Category
$layer->setCurrentCategory($category);
$attributes = $layer->getFilterableAttributes();
foreach ($attributes as $attribute) {
$filterBlockName = 'catalog/layer_filter_attribute';
$result = Mage::app()->getLayout()->createBlock($filterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
foreach($result->getItems() as $option) {
$json[$attribute->getAttributeCode()][] = array(
'attribute_name' => $option->getLabel(),
'attribute_value' => $option->getValue()
);
}
}
return $json;
Now i'm trying to set an filter and get it's related attribute's i.e,. need to fetch it's second level of visible attributes after filter.
did anyone have any hint to solve this ?