How to override search in Magento?

自作多情 提交于 2020-03-03 12:06:43

问题


My user should be able to use the search box to search by some attribute (numeric) it works.

But I'd like to my customer to be able to search using separator.

Example:

search by : 12345678 = works great

search by : 12-34-56-78 = doesn't work

Which will the best way to override magento search to parse/rewrite/modify this behavior?

Thank you


回答1:


If you actually want to override the default search (OOP override, that is) Refer to my earlier answer.

Otherwise @Anton's answer may be enough for you to use the default search which is always preferable.




回答2:


Admin -> Catalog -> Search Terms -> Add New Search term.

Define variants of the searches you want to be redirected else where or found.



来源:https://stackoverflow.com/questions/5406412/how-to-override-search-in-magento

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!