-1

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)

j1rjacob
  • 411
  • 11
  • 27

2 Answers2

0

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()); 
Amit Bera
  • 7,581
  • 7
  • 31
  • 57
0

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.

j1rjacob
  • 411
  • 11
  • 27
  • Hello there, this is a meta comment but don't worry about thanking others only check the answer that works for you in that case your own. If you get the reputation later it's cool to up them but for precedence just check what the problem issue. Don't be sorry for asking a question, there's always worse man – Script Kitty Jun 25 '15 at 03:03