[英]Magento: Fatal error: Call to a member function getItems() on a non-object
We are currently using ManaFilters extension for magento, however we are currently experincing some difficulties with it no being functional. 我们目前正在使用ManaFilters扩展进行magento,但是由于无法正常运行,我们目前遇到了一些困难。
This is the error message it products: 这是它产生的错误消息:
Fatal error: Call to a member function getItems() on a non-object in /var/www/app/code/local/Mana/Filters/Model/Filter/Category.php on line 171 致命错误:在第171行的/var/www/app/code/local/Mana/Filters/Model/Filter/Category.php中的非对象上调用成员函数getItems()
Here is the code associated with line 171: 这是与第171行相关的代码:
/**
* @param Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection $categories
* @return Mana_Filters_Model_Filter_Category
*/
public function addCountToCategories($categories, $products = null) {
if (!$products) {
$products = $this->getLayer()->getProductCollection();
}
$products->addCountToCategories($categories);
if (($items = $categories->getItems()) && count($items)) {
$category = array_shift($items);
if (!$category->hasProductCount()) {
Mage::helper('mana_filters')->addCountToCategories($products, $categories);
}
}
return $this;
}
} }
Any help would be appreciated. 任何帮助,将不胜感激。
Based on your description, $ categories is equal to null when $items = $categories->getItems() is about to be executed. 根据您的描述,$ 类别等于空当$项目= $分类- > getItems()是即将被执行。 Limited by the context you give out, maybe $ categories is alreay null in somewhere else. 受您提供的上下文的限制,也许$ 类别在其他地方确实为null。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.