Fatal error: Call to a member function getChildren() on boolean in C:\xampp\htdocs\magento\test.php on line 30?

Fatal error: Call to a member function getChildren() on boolean in C:\xampp\htdocs\magento\test.php on line 30?

我正在使用最新版本的 magento 并遵循 tut+ 教程 然后我收到上面的错误我冻结了我无法继续。 请帮忙...只是magento的新手

代码在教程中有效我的不是...

文件名test.php

<?php
require_once 'app/Mage.php';

Mage::app();

//Mage_Catalog_Model
$category = Mage::getModel("catalog/category");

var_dump($category->getChildren());

输出必须是:

字符串''(长度=0)

getChildren() 每当我想从类别中获取子类别时。

为此您需要加载类别然后...获取子类别

$category = Mage::getModel("catalog/category")->load($catID)

var_dump($category->getChildren()); 

我的错

我创建了这个 \app\code\local\Mage\Catalog\Model\Category。php

所以 magento 首先在本地文件夹加载这个

我只是删除了 Category.php 它解决了我的很多问题

就像你不能使用 Mage::getModel("catalog/category") 或者你

无法在管理面板管理类别。

抱歉新手提出了愚蠢的问题,谢谢

真诚的回应 我会查看以上答案作为考虑。