简体   繁体   English

Magento:致命错误:在非对象上调用成员函数getItems()

[英]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.

相关问题 Magento:致命错误:在非对象上调用成员函数 getMethodInstance() - Magento : Fatal error: Call to a member function getMethodInstance() on a non-object Magento致命错误-在非对象上调用成员函数getId() - Magento Fatal Error - Call to a member function getId() on a non-object Magento致命错误:在非对象上调用成员函数save() - Magento Fatal error: Call to a member function save() on a non-object 致命错误:在Magento中的非对象上调用成员函数getIdFieldName() - Fatal error: Call to a member function getIdFieldName() on a non-object in Magento 致命错误:在 magento 中的非对象上调用成员函数 getLevel() - Fatal error: Call to a member function getLevel() on a non-object in magento Magento:致命错误:在非对象上调用成员函数 load() - Magento: Fatal error: Call to a member function load() on a non-object 致命错误:在magento中的非对象上调用成员函数getEmail() - Fatal error: Call to a member function getEmail() on a non-object in magento Magento致命错误:在非对象上调用成员函数addFieldToFilter() - Magento Fatal error: Call to a member function addFieldToFilter() on a non-object Magento致命错误:在非对象上调用成员函数getSku() - Magento Fatal Error: Call to member function getSku() on a non-object Magento PHP致命错误:在非对象上调用成员函数setName() - Magento PHP Fatal error: Call to a member function setName() on a non-object
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM