Magento: Get category object from category name
Although this is very weird, to get category object (id, entity_type_id, attribute_set_id, children, etc.) from category name, sometimes it may be useful. Below lines of code will help you in getting it.
$cat = Mage::getResourceModel(‘catalog/category_collection’)->addFieldToFilter(‘name’, ‘Category_Name_Here’);
print_r($cat->getData());
To get the category id from $cat object, simply use:
$cat->getFirstItem()->getEntityId();
#get categories from attribute set #get category object from name #magento category object