人们已经跳过了地面。
在使用magento电子商务(1.7.0.2)时,我在某种特定情况下遇到错误。当用户试图以价格范围过滤目录产品时,情况就是这样。出现的错误是
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.min_price' in 'where clause'
Trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT COUNT(DI...', Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT COUNT(DI...', Array)
#5 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Zend/Db/Adapter/Abstract.php(825): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Varien/Data/Collection/Db.php(225): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#7 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/lib/Varien/Data/Collection.php(225): Varien_Data_Collection_Db->getSize()
#8 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/community/Strategery/Infinitescroll2/Model/Catalog/Observer.php(40): Varien_Data_Collection->getLastPageNumber()
#9 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/App.php(1338): Strategery_Infinitescroll2_Model_Catalog_Observer->modifyCollection(Object(Varien_Event_Observer))
#10 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Strategery_Infinitescroll2_Model_Catalog_Observer), 'modifyCollectio...', Object(Varien_Event_Observer))
#11 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#12 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php(506): Mage::dispatchEvent('catalog_product...', Array)
#13 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(864): Mage_Catalog_Model_Resource_Product_Collection->_beforeLoad()
#14 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Review/Model/Observer.php(78): Mage_Eav_Model_Entity_Collection_Abstract->load()
#15 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/App.php(1338): Mage_Review_Model_Observer->catalogBlockProductCollectionBeforeToHtml(Object(Varien_Event_Observer))
#16 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/App.php(1311): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Review_Model_Observer), 'catalogBlockPro...', Object(Varien_Event_Observer))
#17 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('catalog_block_p...', Array)
#18 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Catalog/Block/Product/List.php(163): Mage::dispatchEvent('catalog_block_p...', Array)
#19 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Catalog_Block_Product_List->_beforeToHtml()
#20 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#21 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('product_list', true)
#22 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Catalog/Block/Category/View.php(85): Mage_Core_Block_Abstract->getChildHtml('product_list')
#23 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/design/frontend/default/madame-modern/template/catalog/category/view.phtml(70): Mage_Catalog_Block_Category_View->getProductListHtml()
#24 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Template.php(241): include('/Applications/X...')
#25 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#26 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#27 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#28 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#29 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#30 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#31 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#32 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/design/frontend/default/madame-modern/template/page/2columns-left.phtml(19): Mage_Core_Block_Abstract->getChildHtml('content')
#33 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Template.php(241): include('/Applications/X...')
#34 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#35 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#36 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#37 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#38 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#39 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Catalog/controllers/CategoryController.php(159): Mage_Core_Controller_Varien_Action->renderLayout()
#40 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_CategoryController->viewAction()
#41 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#42 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#43 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#44 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#45 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/index.php(87): Mage::run('', 'store')
#46 {main}
我一直在追查问题,但收效甚微。我不确定这个问题是否与名为" min_price"在数据库中,或其他任何东西。您可以注意到,错误报告中显示的字符是" e.min_price",而不仅仅是" min_price"。唯一包含这些字符的文件是 app / code / core / Mage / CatalogIndex / Model / Indexer.php
if (strlen($values[$code]['from'])>0) {
$filter[$code]->where(
"($table.min_price".implode('', $additionalCalculations[$code]).")*{$rateConversion} >= ?",
$values[$code]['from']
);
}
if (strlen($values[$code]['to'])>0) {
$filter[$code]->where(
"($table.min_price".implode('', $additionalCalculations[$code]).")*{$rateConversion} <= ?",
$values[$code]['to']
);
}
正如您所看到的,实际上它是&#34; $ table.min_price&#34;而不是&#34; e.min_price&#34;。但这是唯一包含这些字符序列的文件。 (&#34; min_price&#34;出现在其他几个人中)
它可能已引起你的注意,我在这里很丢失。所以,任何帮助将不胜感激。 感谢。
答案 0 :(得分:1)
Strategery_Infinitescroll2
似乎是使用观察者修改集合,看起来他们正试图访问一个不像你想象的那样存在的字段。
在{community|local}/Strategery/Infinitescroll2/Model/Catalog/Observer.php
方法中检入modifyCollectio...()
。
禁用模块以确认它有问题,要么自己修复它也不应该太难以从收集调用中删除/修复支票。
或联系您的供应商。
堆栈跟踪线:
#10 /Applications/XAMPP/xamppfiles/htdocs/parcodesign-setembro/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Strategery_Infinitescroll2_Model_Catalog_Observer), 'modifyCollectio...', Object(Varien_Event_Observer))
答案 1 :(得分:0)
就我而言,问题与app/code/local/Mage/Catalog/Model/Layer/Filter/Price.php
有关
apply()
方法。
此文件未更新到上一版本,apply()
方法仍在调用已弃用的方法$this->_getResource()->applyFilterToCollection($this, $range, $index);
而不是$this->_applyPriceRange();
所以我建议至少对这两个文件使用原始核心文件进行差异处理:
如果您升级了Magento:
小心可能(可能)更多文件没有正确更新,所以我建议审查升级过程。
答案 2 :(得分:-1)
尝试在后端将平面产品目录设置为否