I am using latest version of magento and following a tut+ tutorial then I got error above I am freeze I can't continue. Please help... just a newbie in magento

the code is working at the tutorial mine is not...

filename test.php

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

Mage::app();

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

var_dump($category->getChildren());

The output must be:

string '' (length=0)

2

There are 2 answers

1
j1rjacob On BEST ANSWER

My bad

I created this \app\code\local\Mage\Catalog\Model\Category.php

so magento load this first at local folder

I just remove the Category.php and it solve lot of my problem

like you cannot use Mage::getModel("catalog/category") or you

cannot manage categories at admin dashboard.

Sorry for the dumb question newbie here anyway thanks for

sincere response I will check the above answer as consideration.

0
Amit Bera On

getChildren() which whenever i want to get children category from category.

For this you need load category then ... get children category

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

var_dump($category->getChildren());