如何獲得所有類別和子類別,如果該類別處於活動狀態,但「在導航菜單中包含」設置爲「否」?我如何獲得所有類別和子類別?
我嘗試使用此:
<?php
$_categories = Mage::getBlockSingleton('catalog/navigation');
foreach ($_categories->getStoreCategories() as $_category) {
$category = Mage::getModel('catalog/category');
$category->load($_category->getId());
$subcategories = explode(',', $category->getChildren());
?>
<dl>
<dt><?php echo $this->htmlEscape($_category->getName()); ?></dt>
<dd>
<ol>
<?php
foreach ($subcategories as $subcategoryId) {
$category->load($subcategoryId);
echo '<li><a href="' . $category->getURL() . '">' . $category->getName() . '</a></li>';
}
?>
</ol>
</dd>
</dl>
<?php
}
?>
但是,如果一個類的「在導航菜單中包含‘是’否」,它不會顯示在頭版!
謝謝,你真是幫了!顯示什麼是必要的,然後我將它應該是它! – Oleg