dqmq0654 2012-08-17 01:18
浏览 41

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

We are currently using ManaFilters extension for magento, however we are currently experincing some difficulties with it no being functional.

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

Here is the code associated with line 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.

  • 写回答

1条回答 默认 最新

  • doufuhuang6981 2012-08-17 02:02
    关注

    Based on your description, $categories is equal to null when $items = $categories->getItems() is about to be executed. Limited by the context you give out, maybe $categories is alreay null in somewhere else.

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么