When I am using
$category->getChildren(); and I am getting empty array? I have children categories defined and I can see them via Admin Panel.
Where should I look for the clue?
ok found the solution.
$category is of
Varien_Data_Tree_Node type and
the problem was that in the Magento Config, Maximal Depth was set to 1. That is why I was getting empty collection (
Varien_Data_Tree_Node_Collection) for each category and children_count was OK. Changing Maximal Depth variable to 2 solved the problem.