$collection = Mage::getResourceModel('catalog/category_collection');
$collection->addAttributeToSelect('name')
->addPathFilter('^1/[0-9]+$')
->load();
$options = array();
foreach ($collection as $category) {
$options[] = array(
'label' => $category->getName(),
'value' => $category->getId()
);
}
print_r($options);
No comments:
Post a Comment