I'm using Magento's layered navigation with my custom attributes and price. If I filter by price it works; but when filtering by my custom attributes it shows:
You cannot define a correlation name 'mycustomattribute' more than once
trace:
#0 /home/coloresh/public_html/ColoreSG.com/lib/Varien/Db/Select.php(281):
Zend_Db_Select->_join('inner join', Array, 'metal_idx.entit...', Array, NULL)
#1 /home/coloresh/public_html/ColoreSG.com/lib/Zend/Db/Select.php(336): Varien_Db_Select->_join('inner join', Array, 'metal_idx.entit...', Array, NULL)
#2 /home/coloresh/public_html/ColoreSG.com/lib/Zend/Db/Select.php(315): Zend_Db_Select->joinInner(Array, 'metal_idx.entit...', Array, NULL)
#3 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php(70): Zend_Db_Select->join(Array, 'metal_idx.entit...', Array)
#4 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php(94): Mage_Catalog_Model_Resource_Layer_Filter_Attribute->applyFilterToCollection(Object(Mage_Catalog_Model_Layer_Filter_Attribute), '49')
#5 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php(91): Mage_Catalog_Model_Layer_Filter_Attribute->apply(Object(Mage_Core_Controller_Request_Http), Object(Mage_Catalog_Block_Layer_Filter_Attribute))
#6 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php(73): Mage_Catalog_Block_Layer_Filter_Abstract->_initFilter()
#7 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Catalog/Block/Layer/View.php(136): Mage_Catalog_Block_Layer_Filter_Abstract->init()
#8 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Catalog_Block_Layer_View->_prepareLayout()
#9 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#10 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('catalog/layer_v...', 'catalog.leftnav')
#11 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('catalog/layer_v...', 'catalog.leftnav')
#12 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#13 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#14 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#15 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Catalog/controllers/CategoryController.php(146): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#16 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_CategoryController->viewAction()
#17 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#18 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/coloresh/public_html/ColoreSG.com/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/coloresh/public_html/ColoreSG.com/app/Mage.php(683): Mage_Core_Model_App- >run(Array)
#21 /home/coloresh/public_html/ColoreSG.com/index.php(87): Mage::run('', 'store')
#22 {main}
It is because catalog/layer_view module was called twice. You can search 'type="catalog/layer_view"' through your xml files. Remove the block you don't needed. Or change the type to another class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With