Margo Posted February 10, 2004 Share Posted February 10, 2004 I downloaded Peter Schapler's SearchBox Enhancement which was supposed to do the following: "Now instead of browsing only in the product's name or model name, this search box also by default searches through the product's description, returning more hits." I installed it but it didn't work for me. I want users to be able to search through the product descriptions from the front page instead of having to go to "Advanced Search". Thanks. Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted February 11, 2004 Share Posted February 11, 2004 Does http://www.oscommerce.com/forums/index.php?showtopic=72159 help? Matt Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
Margo Posted February 11, 2004 Author Share Posted February 11, 2004 Thanks. But I didn't have luck with it. Got an error. But I really didn't know where to place the code in my file. I found something in the forums that addressed my question but didn't work either. This is the code I tried in the includes/boxes/search.php but that didn't work: Basically I added tep_draw_hidden_field('search_in_description', '1') . into the page. The full code is below: <?php $boxHeading = BOX_HEADING_SEARCH; $corner_left = 'square'; $corner_right = 'square'; $boxContent_attributes = ' align="center"'; $boxContent = tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); $boxContent .= tep_draw_hidden_field('search_in_description', '1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . 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>'; $boxContent .= '</form>' . '<br><a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a><br>'; require(DIR_WS_TEMPLATES . TEMPLATENAME_BOX); $boxContent_attributes = ''; ?> Quote Link to comment Share on other sites More sharing options...
Margo Posted February 11, 2004 Author Share Posted February 11, 2004 Any idea what I'm doing wrong? Just trying to have the simple search be able to search through the product descriptions in addition to the product names. Thanks Quote Link to comment Share on other sites More sharing options...
mpiscopo Posted February 17, 2004 Share Posted February 17, 2004 Looking at the discussion Matt pointed to earlier I found that I could make one simple change to get the same results you're trying for (to have searches from the left column to default to searching descriptions and names). Below is what I changed [note: the only change I did was to add the tep_draw_hidden_field('search_in_description', '1') at the end of the line]: Original: 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . 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>'); New: 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . 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 . tep_draw_hidden_field('search_in_description', '1') . '</b></a>'); MyR 1 Quote Link to comment Share on other sites More sharing options...
carolannjo Posted January 11, 2008 Share Posted January 11, 2008 Looking at the discussion Matt pointed to earlier I found that I could make one simple change to get the same results you're trying for (to have searches from the left column to default to searching descriptions and names). Below is what I changed [note: the only change I did was to add the tep_draw_hidden_field('search_in_description', '1') at the end of the line]: Original: 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . 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>'); New: 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . 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 . tep_draw_hidden_field('search_in_description', '1') . '</b></a>'); Just found this and it works perfectly. Thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted October 8, 2009 Share Posted October 8, 2009 (edited) thanks mpiscopo it worked perfect. thanks for the info Edited October 8, 2009 by cocktails3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.