2011-11-28 99 views

回答

1

您可以使用下面的代碼,以獲得子類的父類頁:

<?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()); 
    } 
} 

希望這有助於。

謝謝

+0

謝謝,這工作! –

+0

我記得你應該測試一下,如果一個類別是活動的,你也會在這裏得到不活躍的。但現在還不確定。 – Flyingmana

+0

是的Flyinmana是正確的。如果您不想顯示不活動的類別,您應該過濾。謝謝 – MagePsycho