-1

致命错误:在第 135 行的 /home/content/74/10047874/html/shop/app/code/core/Mage/Catalog/Block/Layer/View.php 中的非对象上调用成员函数 setLayer()

 $this->setChild($attribute->getAttributeCode() . '_filter',
            $this->getLayout()->createBlock($filterBlockName)
                ->setLayer($this->getLayer())
                ->setAttributeModel($attribute)
                ->init());

请帮我解决这个问题

4

1 回答 1

-2

尝试注释掉特定页面的整个代码。

或者

将整个代码置于该特定页面的 if 条件中。

例如,如果在 cms 主页中显示错误,则不要这样做。

if(Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')
{}
else
         {
         $this->setChild($attribute->getAttributeCode() . '_filter',
             $this->getLayout()->createBlock($filterBlockName)
                 ->setLayer($this->getLayer())
                 ->setAttributeModel($attribute)
                 ->init());
         }
于 2013-07-22T14:36:45.227 回答