获取magento中根类别的特定/特定类别名称

时间:2012-02-15 12:44:52

标签: magento magento-1.4

在magento网站中,我在根类别下有多个子类别。我只想要一个特定/特定子类别的名称或ID。我怎么能得到它?

1 个答案:

答案 0 :(得分:0)

要加载特定类别,您可以像我使用4

一样定义ID
<?php $_helper    = $this->helper('catalog/output'); ?>

$category_id = $this->getCategoryId();
$childrens = Mage::getModel('catalog/category')->getCollection()
                              ->addFieldToFilter('parent_id', 4)
                 ->addAttributeToSort('name', 'ASC');

&GT;