Has anyone managed to customize the quick search standard text box to search for blog posts?
I think it would be awesome to get the search to do this.
I know in admin -settings there has been a checkbox for ages to check for Search Also In: Pages.
any suggestions?
Thanks
Has anyone managed to customize the quick search standard text box to search for blog posts?
Do you mean admin panel or store-front?
From the store front using the quick search box that is default with cscart.
From the store front using the quick search box that is default with cscart.
Enable search in pages, open the app/functions/fn.search.php file and replace
if (AREA != 'A') {
$params['status'] = 'A';
}
with
if (AREA != 'A') {
$params['status'] = 'A';
$params['page_type'] = array('T', 'L', 'F', 'B');
}
There is also the create_pages_condition_pre hook there. You can use it to extend function with the addon
Thanks again ecomm for the reply and sorry for my delay in checking. I added the 1 line to my PHP file and even cleared the var/cache folder (which I know doesnt need to be done in terms of PHP changes) but it didnt seem to work.
I put the exact words from the page title of my blog in the quick search box and got 0 results.
Any other thoughts on it?
Thanks again in advance
It works on my local installation
http://prntscr.com/ir3uu1
http://prntscr.com/ir3v4d
Please make sure that the changes were added to the fn_create_pages_condition function
ecomlabs
Thanks for taking the time to share this with me.
I will give it another try. Maybe I did something wrong.
Many thanks again.
Ecomlab
i see what my issue was - i read your reply to quickly and missed this part of it
"Enable search in pages"
So i hadnt done that step.
I have now enabled that and yes my blog posts come up in the results mixed with products and pages etc.
I guess I just need to work on the display so the products are shown with their thumbnail like a normal product search originally.
Thanks
Yes, another template is used for mixed search results:
design/themes/THEME/templates/views/search/results.tpl