Answers:
尝试这个:
$collection = Mage::getResourceModel('catalog/category_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('is_active', 1) //only active categories
->addAttributeToFilter('include_in_menu', 0) //only categories not included in menu
->addAttributeToFilter('parent_id', 10)//get only subcategories of the category with id 10
->addAttributeToSort('position')//sort by position
;
foreach ($collection as $category) {
//do something with $category
}
path
字段的某些值可能是错误的。否则父母ID可能是错误的。