Magento:高级搜索结果的分层导航 [英] Magento: Layered Navigation on Advanced Search Results

查看:248
本文介绍了Magento:高级搜索结果的分层导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Magento高级搜索结果页面上显示分层导航过滤器,就像它在catalogsearch结果页面上一样。



我已经将XML根据需要将其嵌入到catalogsearch_advanced_result中:

 < reference name =left> 
< / reference>

该块被调用,但没有任何显示。我追踪了核心文件,发现在Catalog / Block / Layer / View.php中这个函数没有返回任何属性(第161行):

pre > protected function _getFilterableAttributes()
{
$ attributes = $ this-> getData('_ filterable_attributes');
if(is_null($ attributes)){
$ attributes = $ this-> getLayer() - > getFilterableAttributes();
$ this-> setData('_ filterable_attributes',$ attributes);
}

return $ attributes;



$ b我将getFilterableAttributes()追溯到Catalog / Model / Layer.php文件中,但从这一点上,很难找出目录搜索和高级搜索之间的区别。



我基本上只是想以任何可能的方式得到这个工作。任何帮助或指导将不胜感激!



编辑:



属性设置正确如下:



解决方案

我已经成功地在高级搜索页面中分层导航。
执行以下步骤:
步骤1:在 catalogsearch.xml 更新如下

`

 < label>高级搜索结果< / label> 
< update handle =page_two_columns_right/>
<! - Mage_Catalogsearch - >
< reference name =root>
< action method =setTemplate>< template> page / 3columns.phtml< / template>< / action>
< / reference>
< reference name =left>
< / reference>`

第二步:清除缓存,去。

现在获得过滤器的工作,你已经做了一些修改在请求的网址
例如在高级搜索价格过滤器中,像 price [from] = 1& price [to] = 100 而不是 price = 1,100


I need to show the layered navigation filters on the Magento advanced search results page, just like it does on the catalogsearch results page.

I have already moved the XML block as needed into catalogsearch_advanced_result:

<reference name="left">
<block type="catalogsearch/layer" name="catalogsearch.leftnav" template="catalog/layer/view.phtml"/>
</reference>

The block is called, but nothing shows up. I have traced through the core files and found that in Catalog/Block/Layer/View.php this function doesn't return any attributes (line 161):

protected function _getFilterableAttributes()
{
    $attributes = $this->getData('_filterable_attributes');
    if (is_null($attributes)) {
        $attributes = $this->getLayer()->getFilterableAttributes();
        $this->setData('_filterable_attributes', $attributes);
    }

    return $attributes;
}

I traced getFilterableAttributes() into the Catalog/Model/Layer.php file, but from this point it becomes difficult to work out where the difference between catalogsearch and advanced search is.

I basically just want to get this working in any way possible. Any help or guidance would be much appreciated!

EDIT:

My product attributes are set up correctly as below:

解决方案

Hey I have succeeded in bringing the layered navigation in advanced search page. Perform following steps: Step 1: In catalogsearch.xml update like below
`

    <label>Advanced Search Result</label>
    <update handle="page_two_columns_right" />
    <!-- Mage_Catalogsearch -->
    <reference name="root">
        <action method="setTemplate"><template>page/3columns.phtml</template></action>
    </reference>
    <reference name="left">
        <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
    </reference>`

Step 2: Clear your cache and you are good to go.

Now for getting filter worked you have do some modification in the in request url e.g. in advanced search price filter goes like this price[from]=1&price[to]=100 instead of price=1,100

这篇关于Magento:高级搜索结果的分层导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆