Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Advanced Search Feature in product listing


Rayzak

Recommended Posts

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

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

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...