문제

I have category pages and within those are sub-category pages. Those sub-category pages have a sidebar displaying the filterable options within that subcategory. I want to echo out the name of the parent category at the top of that sidebar. I'll need to do this for each parent category.

도움이 되었습니까?

해결책

Try below

$allCategoryIds = ALL_YOUR_CATEGORIES_AS_ARRAY;
foreach($allCategoryIds as $categoryId){
    $_category = Mage::getModel('catalog/category')->load($categoryId);    
    echo $categoryName = $_category->getName()."<br />";  
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top