Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Drop Down List on Home Page GOD HELP


oscommerceking

Recommended Posts

I have a search bar in my header with the normal submit button

 

I want to add a drop down list right next to it that will limit the results for the user

 

 

PLEASE GOD HELP i have spent 8 hours trying to do this and i dont know how the value id's are called

 

please oh please pleas eplease for The love help

 

Thanks

 

Jon

Link to comment
Share on other sites

Try this :D

 

 

<table border="0" width="100%" cellspacing="2" cellpadding="6" >
<tr valign="top">


<?php
echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
?>
<td class="smalltext" valign="top" align="right">
<?php
echo ' ' . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" class="searchForm" style="width: ' . (BOX_WIDTH-10) . 'px"') .' '. tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))) . tep_hide_session_id() . '<br><br> '. tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH);

?>
</td>
</tr>
</table></form></td>

 

Then add the following in /includes/languages/english.php:

 

define('TEXT_ALL_CATEGORIES', 'All Categories');

 

 

 

Matti

Link to comment
Share on other sites

Try this  :D

<table border="0" width="100%" cellspacing="2" cellpadding="6" >
<tr valign="top">
<?php
echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
?>
<td class="smalltext" valign="top" align="right">
<?php
echo ' ' . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" class="searchForm" style="width: ' . (BOX_WIDTH-10) . 'px"') .' '. tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))) . tep_hide_session_id() . '<br><br> '. tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH);

?>
</td>
</tr>
</table></form></td>

 

Then add the following in /includes/languages/english.php:

 

define('TEXT_ALL_CATEGORIES', 'All Categories');

Matti

 

 

 

Excellent Thanks a million, how do i limit the drop down list to main categories only?

 

 

I Tried setting this:

 

tep_draw_hidden_field('inc_subcat', '1', true)

 

To this

 

tep_draw_hidden_field('inc_subcat', '0', false)

 

 

But it didn't affect it

 

Thanks Matti

 

~Jon

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...