CRE Loaded Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Default search function to search within descriptions Solved
PostPosted: Thu Aug 13, 2009 3:45 pm 
Offline
CRE Newbie

Joined: Thu Aug 13, 2009 3:21 pm
Posts: 7
Howdy Folks,

I am trying to have the default search function search within descriptions much like the advanced function does.

I am running CRELoaded 6.4 using the CRE63_ats template if it matters.
After searching the forum up and down and finding numerous fixies for my problem. I implemented them and the results were negative.

I have changed both the search.php

to:
Code:
*/
?>
<!-- search //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
'align' => 'center',
'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><input name="search_in_description" type="hidden" id="1" value="1"><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

new infoBox($info_box_contents);

?>
</td>
</tr>
<!-- search_eof //-->


and the search1.php
to

Code:
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
new infoBoxHeading($info_box_contents, false, false);

$hide = tep_hide_session_id();
$info_box_contents = array();
$info_box_contents[] = array('form' => '<form name="quick_find" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
'align' => 'center',
'text' => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a><br>' . '<input name="search_in_description" type="hidden" id="1" value="1" checked="checked"> Search in description'
);

new infoBox($info_box_contents);
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => tep_draw_separator('pixel_trans.gif', '100%', '1')
);
new infoboxFooter($info_box_contents, true, true);
?>
</td>
</tr>
<!-- search_eof //-->


Please keep in mind i can only find these files under templates/default/boxes/

Can anyone help?
What am i doing wrong?
Thank you.


Last edited by quill on Fri Aug 14, 2009 12:13 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Default search function to search within descriptions
PostPosted: Fri Aug 14, 2009 5:13 am 
Offline
CRE Newbie

Joined: Fri Aug 14, 2009 4:57 am
Posts: 2
Hi.
Your problem is that you are trying to edit the form, NOT the sql query which is used to get the products.
Actually, i just noticed it is very simple to turn on searching in product descriptions.
Open templates/content/advanced_search_result.tpl.php
Go to line 198. You should see the following code:
Code:
//below line is modified
          $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%'   or pd.products_name like '%" . tep_db_input(str_replace("'", "&#39;", tep_db_prepare_input($search_keywords[$i]))) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
          if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
          $where_str .= ')';
          break;

AFTER //below line is modified hit enter and on the new line add:
$_GET['search_in_description']=1;

So your new code should be this:
Code:
//below line is modified
        $_GET['search_in_description']=1;
          $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%'   or pd.products_name like '%" . tep_db_input(str_replace("'", "&#39;", tep_db_prepare_input($search_keywords[$i]))) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
          if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
          $where_str .= ')';
          break;


Cheers.


Top
 Profile  
 
 Post subject: Re: Default search function to search within descriptions
PostPosted: Fri Aug 14, 2009 12:12 pm 
Offline
CRE Newbie

Joined: Thu Aug 13, 2009 3:21 pm
Posts: 7
Thank you.

It worked flawlessly.


Top
 Profile  
 
 Post subject: Re: Default search function to search within descriptions Solved
PostPosted: Sat Mar 20, 2010 3:07 pm 
Offline
CRE Freak

Joined: Sat Jul 11, 2009 9:21 pm
Posts: 50
Thanks so much for that fix. I've been wanting my searches to check the descriptions and couldn't figure out how without just making a link to the advanced search screen.

Much appreciated!! :D
Kelly
http://booksforallreasons.us


Top
 Profile  
 
 Post subject: Re: Default search function to search within descriptions Solved
PostPosted: Tue Dec 14, 2010 6:50 pm 
Offline
CRE Freak
User avatar

Joined: Sun Dec 13, 2009 11:42 pm
Posts: 80
Location: Tucson, AZ
All I can say is THANK YOU!!!

This is exactly what I have been pulling my hair out over and wondering why it's not a "normal" setting in Cre...

_________________
"Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." - Mark Twain

CRE Loaded v6.4.0a PRO -- RVPartsNOW.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Wed Feb 08, 2012 9:11 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

Follow Us on Twitter

An error occurred

Oops, an error seems to have occurred. We're sorry for any inconvenience this might have caused. If the error persists, feel free to tell us about it.

CRE Loaded Community Chat hosted by CRE Loaded.

Join now


Chat about what's on your mind. More about public chats.


© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy