i'm trying to list attributes catalog/category/view.phtml file
How can i do this feature?
i'm trying to list attributes catalog/category/view.phtml file
How can i do this feature?
First to get current layer collection the get list attribute
$CurrentLayer=Mage::getSingleton('catalog/layer');
$attributes = $CurrentLayer->getFilterableAttributes();
foreach ($attributes as $attribute) {
if ($attribute->getAttributeCode() == 'price') {
$filterBlockName = 'catalog/layer_filter_price';
} elseif ($attribute->getBackendType() == 'decimal') {
$filterBlockName = 'catalog/layer_filter_decimal';
} else {
$filterBlockName = 'catalog/layer_filter_attribute';
}
$result = $this->getLayout()->createBlock($filterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
foreach($result->getItems() as $option) {
echo $option->getLabel().'<br/>';
echo $option->getValue();
}
}
Hope i will be working