2016-11-14 60 views
0

由于几天我收到的每一页,该产品集应加载以下错误:Magento的:上装载产品收集致命错误

调用一个成员函数setStoreId()在非-object在 /app/code/core/Mage/Catalog/Model/Category.php上线287

这是函数,发生错误:

public function getProductCollection() 
{ 
    $collection = Mage::getResourceModel('catalog/product_collection') 
     ->setStoreId($this->getStoreId()) 
     ->addCategoryFilter($this); 
    return $collection; 
} 

我不知道发生了什么事。我试图重新索引所有内容并刷新缓存,但我仍然收到此错误。

+0

你可以diff的新鲜(Magento的实例)的核心文件夹中当前的核心,看看,如果事情是改变 – Shrikant

+0

你做一个升级? – Andrew

回答

0
Override /app/code/core/Mage/Catalog/Model/Category.php 

,并尝试这个代码可以帮助你

public function getProductCollection() 
{ 
    $model->setStoreId(Mage::app()->getStore(true)->getId()); 
    $collection = Mage::getResourceModel('catalog/product_collection') 
     ->setStoreId($this->getStoreId()) 
     ->addCategoryFilter($this); 
    return $collection; 
} 
相关问题