magento category Ids Name

如何获取产品的分类的名称 和ids

1.对于产品的分类ids 的获取
      $this->getProduct()->getCategoryIds()

2.对应产品的分类的Name 的获取

$category = Mage::getModel('catalog/category')->load($this->getProduct()->getCategoryIds());
echo $category->getName();

谢谢惠顾

你可能感兴趣的:(agent)