Looking to find the category ID
using the Name
attribute programmatically. My script returns a 1 when it should be a 19. Here is my code:
$collection = Mage::getModel('catalog/category')->getCollection()
->addAttributeToFilter('is_active', 1)
->addAttributeToFilter('parent_id', $currentCategoryId)
->addAttributeToFilter('name', $categoryName);
which should return the category right? Then the script utilizes $catid = $collection->getFirstItem()->getId();
to get the ID, however it is returning the wrong ID. Any ideas?