当没有指定搜索词时,如何使 Magento 高级搜索显示所有产品?
有人可以帮我解决这个问题吗?
我在 magento 上使用高级搜索,效果很好,但是当我单击“搜索”而不输入任何搜索词时,它会出现错误或注释:“请指定至少一个搜索词。”
我希望当我点击“搜索”而不输入任何搜索词时,它会显示我所有类别中的所有产品,这怎么可能?
先感谢您。 您的帮助:))
问候
非常感谢 我使用magento 1.5社区版本
Can anyone help me with this problem please?
I use advanced search on magento and it works well, but when I click on "Search" without entering any search terms it gives error or note: "Please specify at least one search term."
I'd like it to show All my products in all categories when I click on "search" without entering any search terms, how is it possible?
Thank you in advance.
Your Help is much appreciated : ))
Regards
P.S. I Use magento 1.5 community version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在系统下->配置->目录->目录搜索
将“最小查询长度”更改为 0,然后再次尝试搜索。
我想指出的是,通配符搜索可能非常繁重,具体取决于您搜索的属性数量以及产品数量。这也取决于 LIKE 与 FULLTEXT。
至于第二个问题,这可以处理上面admin中同一位置的分层导航。我会将“如果搜索结果小于则应用分层导航”的数量设置为等于主要可见性中的产品数量。默认情况下,类别是分层导航的一部分。
Under System -> Configuration -> Catalog -> Catalog Search
Change "Minimal Query Length" to 0 and attempt your search again.
I would like to note that wildcard searches can be very taxing depending on the number of attributes that you are searching on, as well the number of products. This can also depend on LIKE vs FULLTEXT.
As for the second question, this can deal with the Layered Navigation on the same place in admin above. I would set the number for "Apply Layered Navigation if Search Results are Less Than" equal to the number of products you have in your primary visibility. Categories are part of layered navigation by default.
这是一篇旧帖子,但由于我最近遇到了同样的问题,这就是我解决它的方法。拒绝您能够在没有任何参数的情况下进行搜索的代码位于文件中
第 208 行函数 addFilters() 中(Magento v1.8.1):
因此我们要做的是摆脱抛出的异常。由于我们不想修改任何核心文件,因此我们重写此类并重载 addFilters() 函数以捕获异常,从而启用空的高级搜索。
在您的模块中创建文件
}
并用新模型重写原始高级搜索模型:
这应该可以解决问题。
This is an old post but since i ran into the same problem recently here's how i solved it. The code denying you to be able to search without any parameters lies within the file
in function addFilters() on line 208 (Magento v1.8.1):
So what we want to do is get rid of the Exception beeing thrown. Since we want to never modify any core files we rewrite this class and overload the addFilters() function to catch the Exception, thus enabling an empty advanced search.
Within your module create the file
}
and rewrite the original advanced search model with your new one:
That should do the trick.