Magento get Filter Options shop by Attribute
$layer = Mage::getModel("catalog/layer");
$layer = Mage::getModel("catalog/layer");
$category = Mage::getModel("catalog/category")->load(3);
$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) {
echo $option->getLabel().'<br/>';
echo $option->getValue();
}
}
1 comments:
commentsThank you for sharing this information
ReplyMagento development company