Magento 1.9:删除分层导航中的类别过滤器
-
11-12-2019 - |
题
经过几分钟的搜索,我发现了我正在寻找的解决方案,它在这里: 如何禁用FilterBar
我通过@pandawebstudio编辑Catalog.xml遵循此方法
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
.
与
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
<action method="unsetChild"><child>category_filter</child></action>
</block>
.
悲伤地,它不起作用。然后我通过@maurice滚动并找到另一个解决方案
(当前)推荐的方式制作布局更改使用主题的本地.xml。因此,使用local.xml时,请添加以下内容:
<catalog_category_layered>
<reference name="catalog.leftnav">
<action method="unsetChild"><child>category_filter</child></action>
</reference>
</catalog_category_layered>
.
如果需要,可以通过将以下内容添加到local.xml:,添加常规(不可过滤)类别菜单。
<catalog_category_layered>
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav.categories" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
<reference name="catalog.leftnav">
<action method="unsetChild"><child>category_filter</child></action>
</reference>
</catalog_category_layered>
.
它的工作。它在分层导航中删除了我的类别过滤器。但问题是,民意调查和迷你购物车出现。页面内容消失了。只有轮询和迷你购物车出现在我的页面中,只有没有产品和静态内容。
我想知道我在哪里出错了。我尝试将追逐=“货币”更改为之前=“ - ”,因为这就是我的XML内部的内容,但它仍然没有用。我想我只需要在后面的价值中修改一些东西,因为我在侧边栏中没有货币块。这就是我不知道的。
我希望一只魔法大师可以启发我。 :(
解决方案
jehzlau,不需要XML代码,如果你制作这个类别是锚不是它自动呼叫
<catalog_category_default translate="label">
<label>Catalog Category (Non-Anchor)</label>
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
.....
.
用于非锚类别
如果需要使用XML尝试这个
<catalog_category_layered>
<reference name="left">
<remove name="catalog.leftnav" />
<block type="catalog/navigation" name="catalog.leftnav.categories" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
</catalog_category_layered>
. 其他提示
只是在magento admin >>>转到自定义设计选项卡>>>在“自定义布局更新”字段中添加te ...
<reference name="catalog.leftnav">
<action method="unsetChild"><alias>category_filter</alias></action>
</reference>
.
您的类别过滤器将用于该特定类别。重复此操作以从其他类别中删除类别过滤器...
享受...