I am trying to get loaded product attributes from Layered navigation into listing page.
The below code is working fine if I print $grid_labels[]
When I am applying/selecting layered navigation filter, i am getting the following error :
You cannot define a correlation name 'manufacturer_idx' more than once
I am unable to identify why the block/attributes are loading twice.
$block = $this->getLayout()->createBlock('Catalog/Layer_View');
$_filters = $block->getFilters();
$grid_label = array();
$grid_attribute_code = array();
//echo "<pre>";
foreach ($_filters as $_filter) {
if ($count = $_filter->getItemsCount()) {
$attr = Mage::getModel('eav/entity_attribute')->getCollection()->addFieldToFilter('frontend_label', $_filter->getName());
$attcodeobj = $attr->getData();
$attrcode = $attcodeobj[0]['attribute_code'];
if($attrcode!=''):
$grid_label[] = array($attrcode => $_filter->getName());
endif;
//$grid_attribute_code[] = $_filter->getLabel();
}
}
Can any one help me out on this issue ?
$block = $this->getLayout()->getBlock('catalog.leftnav');
instead of createBlock()?