0

我遇到了一个问题,我不知道如何解决它。我对 Magento 和 PHP 很陌生,所以对错误了解不多,我通常用谷歌搜索它来修复它,但似乎找不到任何解决这个问题的东西。

我收到以下错误。升级到 1.6.2.0 后,Magento 使用了一个名为“modern”的主题,但是当我将其更改为原来的主题时,我得到了错误。我还附上了错误似乎源于错误的文件“list_sidebar.phtml”。

任何帮助将不胜感激。

There has been an error processing your request

Invalid method Mage_Catalog_Block_Product_List::myGetProductCollection(Array
(
    [0] => 18
)
)

Trace:
#0 /home/lailides/devmagento/store/app/design/frontend/default/lailides/template/catalog/product/list_sidebar.phtml(47): Varien_Object->__call('myGetProductCol...', Array)
#1 /home/lailides/devmagento/store/app/design/frontend/default/lailides/template/catalog/product/list_sidebar.phtml(47): Mage_Catalog_Block_Product_List->myGetProductCollection('18')
#2 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Template.php(241): include('/home/lailides/...')
#3 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#4 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#6 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#8 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#9 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('left', true)
#10 /home/lailides/devmagento/store/app/design/frontend/default/lailides/template/page/3columns.phtml(46): Mage_Core_Block_Abstract->getChildHtml('left')
#11 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Template.php(241): include('/home/lailides/...')
#12 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#13 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home/lailides/devmagento/store/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#15 /home/lailides/devmagento/store/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#16 /home/lailides/devmagento/store/app/code/core/Mage/Core/Controller/Varien/Action.php(391): Mage_Core_Model_Layout->getOutput()
#17 /home/lailides/devmagento/store/app/code/core/Mage/Cms/Helper/Page.php(132): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /home/lailides/devmagento/store/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#19 /home/lailides/devmagento/store/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#20 /home/lailides/devmagento/store/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Cms_IndexController->indexAction()
#21 /home/lailides/devmagento/store/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#22 /home/lailides/devmagento/store/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /home/lailides/devmagento/store/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#24 /home/lailides/devmagento/store/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#25 /home/lailides/devmagento/store/index.php(80): Mage::run('', 'store') 
4

2 回答 2

0

正如丹尼尔所说,如果您覆盖了核心文件,则必须对核心文件进行一些直接定制。

如果您不直接替换核心文件并且您在不同的位置进行升级然后检查 app\code\local 或 app\code\community 可能有自定义模块覆盖类 Mage_Catalog_Block_Product_List 并具有自定义功能,那么您可以移动该模块它可能会再次开始工作。

祝你好运!

于 2012-07-09T00:11:34.797 回答
0

一种可能的情况是,在您的 1.3.0.0 安装中,核心被直接修改为包含一个myGetProductCollection方法,并且在升级过程中被覆盖。

您应该在原始安装和Magento 1.3.0.0之间进行比较。这应该告诉您您的核心与标准 Magento 安装有何不同。

一旦确定了这些缺失的方法,就应该改用重写来实现它们,这样下次升级时就不会发生同样的事情。

于 2012-07-08T18:54:36.087 回答