In front-end I am displaying all category of first level.
Now I want to check Is there any category either available or not in first level.
I am using this code and getting all categories.
public function getCategory()
{
$parentCategoryId = Mage::app()->getStore()->getRootCategoryId();
$categories = Mage::getModel('catalog/category')
->getCollection()
->addFieldToFilter('parent_id', array('eq'=>$parentCategoryId))
->addFieldToFilter('is_active', array('eq'=>'1'))
->addAttributeToFilter('level', 2)
->addAttributeToSelect('*');
return $categories;
}
If there is no category available then I want to display a message but I don't know how to check category is available or not in first level.