持久的左栏导航

时间:2014-03-23 23:14:54

标签: magento magento-1.7

只是想知道如何在Magento Blanco主题的左栏中获得持久类别导航。

http://wilfrednewman.com/products.html

此处可用,此处不提供: http://wilfrednewman.com/store 或者在这里: http://wilfrednewman.com/products/suits.html

我怎么能让它在那里展示?

谢谢你们!

2 个答案:

答案 0 :(得分:2)

首先,检查一下url-key。该网址的类别ID是什么?

检查主题中的 catalog.xml (如果不存在则创建新内容)

on

  

catalog_category_view

添加该引用

<reference name="left">
    <block name="category.tree" type="adminhtml/catalog_category_tree" template="catalog/category/tree.phtml" />
</reference>

答案 1 :(得分:1)

我认为这会对你有帮助, 转到管理面板“catalog-&gt; manage categories”然后单击类别Suits并导航到“display settings”然后设置为Anchor为“yes”,

编辑: -

您需要编辑left.phtml文件(template / catalog / navigation / left.phtml)。

添加替换代码。

<div class="catlistside">
<h2><?php echo $this->__('Categories') ?></h2>
<ul class="catlist">
<?php
$obj = new Mage_Catalog_Block_Navigation();
$store_cats = $obj->getStoreCategories();
$current_cat    = $obj->getCurrentCategory();
$current_cat    = (is_object($current_cat) ? $current_cat->getName() : '');

foreach ($store_cats as $cat) {
if ($cat->getName() == $current_cat) {
    echo '<li class="current">
<a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."</a>\n<ul>\n";
    foreach ($obj->getCurrentChildCategories() as $subcat) {
        echo '<li>
<a href="'.$this->getCategoryUrl($subcat).'">'.$subcat->getName()."</a></li>\n";
    }
    echo "</ul>\n</li>\n";
} else {
echo '<li><a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()." </a>
</li>\n";
}
}
?>
</ul>
</div>
相关问题