Mukesh Ravi Posted October 18, 2013 Share Posted October 18, 2013 Hello Everyone, I am using Prestashop 1.5.5. I want make a search from cms pages also. Is there any way to perform search in cms pages also. Please suggest. Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted October 18, 2013 Share Posted October 18, 2013 Yes, but you need a custom module and custom queries, are you a programmer? Link to comment Share on other sites More sharing options...
Mukesh Ravi Posted October 18, 2013 Author Share Posted October 18, 2013 Yes Nemo, Please guide me about this. Link to comment Share on other sites More sharing options...
Mukesh Ravi Posted October 23, 2013 Author Share Posted October 23, 2013 any idea?? Link to comment Share on other sites More sharing options...
NemoPS Posted October 23, 2013 Share Posted October 23, 2013 Sorry for my late reply. It's hard to guide you step by step from single forum post, so I'll give you general guidelines of what I'd do. I'd create a module to hold the search box. This module would come with a (I'm just inventing names here) cmsSearchController. The search button of this module would drive the user to that page. Here, the controller would submit the searched term to the new class CmsSearch.php, calling its method find(). You can copy part of the native search engine here, till the point where it looks int the search index. Now comes the tricky part. A search engine needs a search index table to look for keywords. It would take ages for a sql query to search in a big single field such as the cms content. Therefore, my suggestion is to create a new table 'cms_search_index' (id_cms, id_lang, keyword). Create a button in the module, which you can use to scan all your cms articles and add words over a certain number of characters you decide.) Once they are added, in the search's find() method I previously mentioned, look for each of the keywords the user entered in the cms_search_index table, order by number of occurrences, then, depending on the type of search you want (match any keyword, or match all) intersect or merge the arrays generated by each keyword search. With the retrieved cms ids, use a query to grab what you need to be displayed in the search list, and return them to the controller, which will display them using a template file. THis is what I'd generally do Link to comment Share on other sites More sharing options...
Guest locen Posted March 23, 2016 Share Posted March 23, 2016 Hi Mukesh, How you solved? I use version 1.6.0.9 Link to comment Share on other sites More sharing options...
Daresh Posted April 19, 2016 Share Posted April 19, 2016 Hi, check out this module: Smart CMS Search 1 Link to comment Share on other sites More sharing options...
Guest locen Posted April 19, 2016 Share Posted April 19, 2016 Thanks but this is not that i want. i would search only in cms pages with separate search bar. Link to comment Share on other sites More sharing options...
NemoPS Posted April 20, 2016 Share Posted April 20, 2016 You really need to develop a separate search engine for it then Link to comment Share on other sites More sharing options...
Guest locen Posted April 20, 2016 Share Posted April 20, 2016 Thanks nemo. Link to comment Share on other sites More sharing options...
Recommended Posts