我收到如下错误,我不知道如何解决此错误,因为我是magento的新手。如果有错误格式的描述,它也会帮助我。我无法解决这个问题的主要原因是因为我首先不理解这个错误。
a:5:{i:0;s:638:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cat_index_position' in 'order clause', query was: SELECT DISTINCT `e`.`attribute_set_id` FROM `catalog_product_flat_11` AS `e`
INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=11 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '393' AND cat_index.is_parent=1
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 ORDER BY `cat_index_position` ASC, `cat_index`.`position` ASC LIMIT 12";i:1;s:4448:"#0 /home1/poojakit/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home1/poojakit/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home1/poojakit/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home1/poojakit/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT DISTINCT...', Array)
#4 /home1/poojakit/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT DISTINCT...', Array)
#5 /home1/poojakit/public_html/lib/Zend/Db/Adapter/Abstract.php(794): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home1/poojakit/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php(1096): Zend_Db_Adapter_Abstract->fetchCol(Object(Varien_Db_Select))
#7 /home1/poojakit/public_html/app/code/core/Mage/Catalog/Model/Layer.php(290): Mage_Catalog_Model_Resource_Product_Collection->getSetIds()
#8 /home1/poojakit/public_html/app/code/core/Mage/Catalog/Model/Layer.php(220): Mage_Catalog_Model_Layer->_getSetIds()
#9 /home1/poojakit/public_html/app/code/core/Mage/Catalog/Block/Layer/View.php(163): Mage_Catalog_Model_Layer->getFilterableAttributes()
#10 /home1/poojakit/public_html/app/code/core/Mage/Catalog/Block/Layer/View.php(122): Mage_Catalog_Block_Layer_View->_getFilterableAttributes()
#11 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Catalog_Block_Layer_View->_prepareLayout()
#12 /home1/poojakit/public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#13 /home1/poojakit/public_html/app/code/local/MGS/Mpanel/Helper/Data.php(3267): Mage_Core_Model_Layout->createBlock('catalog/layer_v...')
#14 /home1/poojakit/public_html/app/design/frontend/mgstheme/default/template/mgs/mpanel/template/layout/category/right.phtml(7): MGS_Mpanel_Helper_Data->renderContent('218')
#15 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home1/poojakit...')
#16 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/mgsthe...')
#17 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#18 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#19 /home1/poojakit/public_html/app/code/local/MGS/Mpanel/Helper/Data.php(3091): Mage_Core_Block_Abstract->toHtml()
#20 /home1/poojakit/public_html/app/design/frontend/mgstheme/cetus/template/page/2columns-right.phtml(106): MGS_Mpanel_Helper_Data->getCategoryRight()
#21 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home1/poojakit...')
#22 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/mgsthe...')
#23 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#24 /home1/poojakit/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#25 /home1/poojakit/public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#26 /home1/poojakit/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#27 /home1/poojakit/public_html/app/code/local/MGS/Mpanel/controllers/Catalog/CategoryController.php(143): Mage_Core_Controller_Varien_Action->renderLayout()
#28 /home1/poojakit/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): MGS_Mpanel_Catalog_CategoryController->viewAction()
#29 /home1/poojakit/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#30 /home1/poojakit/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#31 /home1/poojakit/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#32 /home1/poojakit/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#33 /home1/poojakit/public_html/index.php(88): Mage::run('', 'store')
#34 {main}";s:3:"url";s:48:"/index.php/poojakits/pooja-items/pooja-kits.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:2:"en";}
答案 0 :(得分:3)
这似乎是在启用Flat Categories和/或Products并且块调用产品集合的addAttributeToSort()时发生的Magento错误。 “order by”子句中的列应为cat_index
。position
而不是cat_index_position
。
我发现this extension声称可以解决问题,但我自己还没有测试过。
答案 1 :(得分:0)
Mage_Catalog_Model_Layer-> getFilterableAttributes()
导致此查询。
我建议您重新索引属性,然后再次检查。
您可能已添加或删除了某些属性,但DB逻辑关系不存在。
如果这不起作用,那么您需要检查处理属性的社区模块。