Guest Posted October 21, 2009 Posted October 21, 2009 When we use the search feature on the first page only the text in the product title is searched. A customer can only search the description field if they fo to Advanced Search. Is there a way to make the first search attempt to include the description?
Guest Posted October 22, 2009 Posted October 22, 2009 I need to add this to one of my sites. Hope someone answers.....
Black Jack 21 Posted October 22, 2009 Posted October 22, 2009 boxes->search.php <?php /* $Id: search.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); 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" style="width: ' . (BOX_WIDTH-30) . 'px"') . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . ' ' . 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 infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //--> That's what you are looking for: tep_draw_hidden_field('search_in_description','1' Cheers
Guest Posted October 22, 2009 Posted October 22, 2009 boxes->search.php <?php /* $Id: search.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); 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" style="width: ' . (BOX_WIDTH-30) . 'px"') . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . ' ' . 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 infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //--> That's what you are looking for: tep_draw_hidden_field('search_in_description','1' Cheers I feel this is the solution to my problem but it doesnt want to work!!! This is what i have and it seems to be the same code you have: <?php /* $Id: search.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); 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" style="width: ' . (BOX_WIDTH-30) . 'px"') . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . 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 infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //--> I DON'T SEE WHY IT DOESN'T WANT TO WORK!!!!! HELP!!!! Thanks in Advance!!!!!!!! :)
edwardh50g Posted December 20, 2009 Posted December 20, 2009 I feel this is the solution to my problem but it doesnt want to work!!! This is what i have and it seems to be the same code you have: <?php /* $Id: search.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); 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" style="width: ' . (BOX_WIDTH-30) . 'px"') . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . 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 infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //--> I DON'T SEE WHY IT DOESN'T WANT TO WORK!!!!! HELP!!!! Thanks in Advance!!!!!!!! :) It works. Find: ".tep_hide_session_id()" Insert: ". tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . ' '" Become: ". tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . ' ' .tep_hide_session_id()"
nealc Posted December 21, 2009 Posted December 21, 2009 It works. Find: ".tep_hide_session_id()" Insert: ". tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . ' '" Become: ". tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . ' ' .tep_hide_session_id()" Thank you for posting this, it helped me out!! I am currently just learning osCommerce and PHP, but am always willing to help out. Have successfully installed the following: Discount Coupons, UPS shipping module, Ultimate SEO URL's, Easy Meta Tags for SEO 1.0, Google XML Sitemap SEO v1.3, HTML Editor for Email and Newsletters.
digitalpowerpro Posted February 8, 2010 Posted February 8, 2010 Thanks so much, I have been wondering how to change that for months, I just added it to our website and it works great! www.digitalpowerpro.com Thanks Zach
Recommended Posts
Archived
This topic is now archived and is closed to further replies.