2016-11-14 59 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; 
} 
相關問題