Magento在搜索产品时出错

时间:2014-03-06 02:09:20

标签: php magento

问题出现在目录搜索中,当我在主页上搜索名为“搜索整个商店”的搜索框中输入任何产品时。它给出了“处理您的请求时出错”,并出现以下错误

a:5:{i:0;s:60:"Category must be an instance of Mage_Catalog_Model_Category.";i:1;s:4744:"#0 C:\wamp\www\shop\app\code\core\Mage\Catalog\Model\Layer.php(187): Mage::throwException('Category must b...')

1.C:\wamp\www\shop\app\design\frontend\evoque\default\template\catalog\product\list\toolbar.phtml(111): Mage_Catalog_Model_Layer->setCurrentCategory(NULL)

2 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(241): include('C:\wamp\www\sho...')

3 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template-fetchView('frontend\evoque...')

4 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()

5 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template->_toHtml()

6 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract->toHtml()

7 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('toolbar', true)

8 C:\wamp\www\shop\app\code\core\Mage\Catalog\Block\Product\List.php(204): Mage_Core_Block_Abstract->getChildHtml('toolbar')

9 C:\wamp\www\shop\app\design\frontend\evoque\default\template\catalog\product\list.phtml(50): Mage_Catalog_Block_Product_List->getToolbarHtml()

10 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(241): include('C:\wamp\www\sho...')

11 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template-
>fetchView('frontend\evoque...')

12 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()

13 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template->_toHtml()

14 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract->toHtml()

15 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('search_result_l...', true)

16 C:\wamp\www\shop\app\code\core\Mage\CatalogSearch\Block\Result.php(161): Mage_Core_Block_Abstract->getChildHtml('search_result_l...')

17 C:\wamp\www\shop\app\design\frontend\base\default\template\catalogsearch\result.phtml(42): Mage_CatalogSearch_Block_Result->getProductListHtml()

18 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(241): include('C:\wamp\www\sho...')

19 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template->fetchView('frontend\base\d...')

20 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()

21 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template->_toHtml()

22 C:\wamp\www\shop\app\code\local\Etheme\Evoqueconfig\Block\Core\Text\List.php(23): Mage_Core_Block_Abstract->toHtml()

23 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(919): Etheme_Evoqueconfig_Block_Core_Text_List->_toHtml()

24 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract->toHtml()

25 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)

26 C:\wamp\www\shop\app\design\frontend\evoque\default\template\page\3columns.phtml(59): Mage_Core_Block_Abstract->getChildHtml('content')

27 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(241): include('C:\wamp\www\sho...')

28 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template->fetchView('frontend\evoque...')

29 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()

30 C:\wamp\www\shop\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template->_toHtml()

31 C:\wamp\www\shop\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract->toHtml()

32 C:\wamp\www\shop\app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout->getOutput()

33 C:\wamp\www\shop\app\code\core\Mage\CatalogSearch\controllers\ResultController.php(80): Mage_Core_Controller_Varien_Action->renderLayout()

34 C:\wamp\www\shop\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_CatalogSearch_ResultController->indexAction()

35 C:\wamp\www\shop\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')

36 C:\wamp\www\shop\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

37 C:\wamp\www\shop\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()

38 C:\wamp\www\shop\app\Mage.php(684): Mage_Core_Model_App->run(Array)

39 C:\wamp\www\shop\index.php(87): Mage::run('', 'store')

40 {main}";s:3:"url";s:42:"/shop/index.php/catalogsearch/result/?q=sk";s:11:"script_name";s:15:"/shop/index.php";s:4:"skin";s:7:"default";}

任何帮助都将受到高度赞赏,Ivan Stein

1 个答案:

答案 0 :(得分:-1)

有些东西在某处混淆了。我要么说某人做了主题没有预期的修改,通过Magento Admin的某个商店或类别配置,或者evoque主题中的错误。

Evoque是一个高级主题,你可以get support from the authors here

我们可以从错误报告中看到失败点是文件C:\wamp\www\shop\app\design\frontend\evoque\default\template\catalog\product\list\toolbar.phtml

的第111行

要修复此故障,您应检查该文件,并在执行第111行之前测试空类别,或者进行一些分析以找出特定用例的类别为NULL的原因。

可以在这里粘贴toolbar.phtml的第101到121行,你可以得到一个解决方案(包括创建一个更健壮的toolbar.phtml的自定义子主题)但我建议在official theme support site提出罚单。