سؤال

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