Magento 分层导航“您不能多次定义相关名称‘mycustomattribute’" [英] Magento Layered Navigation "You cannot define a correlation name 'mycustomattribute' more than once "

查看:11
本文介绍了Magento 分层导航“您不能多次定义相关名称‘mycustomattribute’"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Magento 的分层导航以及我的自定义属性和价格.如果我按价格过滤它会起作用;但是当按我的自定义属性过滤时,它显示:

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:

您不能多次定义关联名称mycustomattribute"

You cannot define a correlation name 'mycustomattribute' more than once

追踪:

#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}

推荐答案

是因为catalog/layer_view模块被调用了两次.您可以通过 xml 文件搜索 'type="catalog/layer_view"'.删除不需要的块.或者将类型更改为另一个类

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

这篇关于Magento 分层导航“您不能多次定义相关名称‘mycustomattribute’"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆