【发布时间】:2012-10-26 06:05:59
【问题描述】:
我需要在 Magento 高级搜索结果页面上显示分层导航过滤器,就像在目录搜索结果页面上一样。
我已经根据需要将 XML 块移动到 catalogsearch_advanced_result:
<reference name="left">
<block type="catalogsearch/layer" name="catalogsearch.leftnav" template="catalog/layer/view.phtml"/>
</reference>
块被调用,但没有任何显示。我跟踪了核心文件,发现在 Catalog/Block/Layer/View.php 中这个函数没有返回任何属性(第 161 行):
protected function _getFilterableAttributes()
{
$attributes = $this->getData('_filterable_attributes');
if (is_null($attributes)) {
$attributes = $this->getLayer()->getFilterableAttributes();
$this->setData('_filterable_attributes', $attributes);
}
return $attributes;
}
我将 getFilterableAttributes() 追踪到 Catalog/Model/Layer.php 文件中,但从这一点来看,很难弄清楚目录搜索和高级搜索之间的区别在哪里。
我基本上只是想让它以任何可能的方式工作。任何帮助或指导将不胜感激!
编辑:
我的产品属性设置正确如下:
【问题讨论】:
-
你的属性是
is_filterable_in_search(而不仅仅是is_filterable)吗? -
查看我上面的编辑,这是我的属性设置方式。
-
高级搜索和分层导航不能混用。
-
我不明白为什么不这样做 - 它必须以与目录搜索相同的方式工作。它只需要根据选择的过滤器(由产品集合数据缩小范围)附加一个查询字符串
-
上周我遇到了同样的问题,我只是不使用高级搜索而是将正确的参数发布到列表页面。 (意味着我创建了自己的高级搜索,只使用分层导航。)
标签: magento search filter catalog advanced-search