Php Magento-输出产品';s类别,但将其筛选为仅显示一个类别树
如果已经有人问过我,我会道歉,但是我已经搜索了很多次,但是没有找到一个足够具体的答案来满足我的需求 基本上,在我的产品面板上,我想输出特定于该产品的所有类别,我使用以下代码完成了这项工作:Php Magento-输出产品';s类别,但将其筛选为仅显示一个类别树,php,magento,categories,product,Php,Magento,Categories,Product,如果已经有人问过我,我会道歉,但是我已经搜索了很多次,但是没有找到一个足够具体的答案来满足我的需求 基本上,在我的产品面板上,我想输出特定于该产品的所有类别,我使用以下代码完成了这项工作: $currentCatIds = $_product->getCategoryIds(); $categoryCollection = Mage::getResourceModel('catalog/category_collection') ->addAttributeToSelect('nam
$currentCatIds = $_product->getCategoryIds();
$categoryCollection = Mage::getResourceModel('catalog/category_collection')
->addAttributeToSelect('name')
->addAttributeToSelect('url')
->addAttributeToFilter('entity_id', $currentCatIds)
->addIsActiveFilter();
foreach($categoryCollection as $cat){ ?>
<a href="<?php echo $cat->getUrl(); ?>" title="<?php echo $cat->getName(); ?>"><?php echo $cat->getName(); ?></a>
<?php }
$currentCatIds=$\u product->getCategoryIds();
$categoryCollection=Mage::getResourceModel('catalog/category_collection'))
->addAttributeToSelect('名称')
->addAttributeToSelect('url')
->addAttributeToFilter('entity_id',$currentCatIds)
->addIsActiveFilter();
foreach($categoryCollection作为$cat){?>