【发布时间】:2011-11-28 07:49:29
【问题描述】:
我正在使用带有水平菜单的 Magento。此菜单显示所有父类别。我想要的是显示点击的父类别的子类别。
我怎么能意识到这一点?
提前致谢!
【问题讨论】:
标签: magento categories
我正在使用带有水平菜单的 Magento。此菜单显示所有父类别。我想要的是显示点击的父类别的子类别。
我怎么能意识到这一点?
提前致谢!
【问题讨论】:
标签: magento categories
您可以使用以下代码来获取父类别页面中的子类别:
<?php
$parentCategory = Mage::registry('current_category');
if($parentCategory){
$catId = $parentCategory->getId();
$category = Mage::getModel('catalog/category')->load($catId);
$childCategories = $category->getChildrenCategories();
foreach($childCategories as $_category){
print_r($_category->getData());
}
}
希望这会有所帮助。
谢谢
【讨论】: