Rayzak Posted August 27, 2005 Share Posted August 27, 2005 Hello I'm trying to integrate search into product listing, it is working, but I can not make it select the present category by default. Can someone correct the code please? <table border="0" width="100%" cellspacing="0" cellpadding="1"> <tr> <td class="infoBoxContents" valign="top" colspan="3">' . BOX_ADVSEARCH_KW . ' </td> <td class="infoBoxContents" valign="top" colspan="3">' . BOX_ADVSEARCH_PRICERANGE . ' </td> <td class="infoBoxContents" valign="top" colspan="3">' . BOX_ADVSEARCH_CAT . ' </td> </tr> <tr> <td class="infoBoxContents" valign="top" colspan="3">' . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="30" maxlength="30" ') . ' </td> <td class="infoBoxContents" valign="top" colspan="3">' . tep_draw_input_field('pfrom','','size="9" maxlength="8"') . BOX_ADVSEARCH_PRICESEP . tep_draw_input_field('pto','','size="9" maxlength="8"') . ' </td> <td class="infoBoxContents" valign="top" colspan="3">' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ADVSEARCH_ALLCAT)))) . ' </td> </tr> <tr> <td class="infoBoxContents" valign="top" colspan="3"> </td> </tr> <tr> <td class="infoBoxContents" valign="top" colspan="3"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_ADVSEARCH) . ' </td> </tr> </table> Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2005 Share Posted August 27, 2005 The third parameter of the tep_draw_pull_down_menu is the default index to pick from the list of categories. The current categories id can be retrieved from this variable: $current_category_id But you need to translate it to the list index before passing it as an argument to the tep_draw_pull_down_menu Link to comment Share on other sites More sharing options...
Rayzak Posted September 21, 2005 Author Share Posted September 21, 2005 Thanks to enigma1 You can get the Contribution in there: http://www.oscommerce.com/community/contributions,3567 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.