Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Search Box


Guest

Recommended Posts

I am trying to make a new search function but i am not having much luck.

 

Basicly what I need is a new box with 3 drop down menus.

 

The first drop down menu would be everything that is in categories_name_2 in my database.

 

the second drop down menu would be categories_name_3

 

and the third drop down would be categories_name_4

 

now the trick part for me atleast is say for arguement sake that in categories_name_2 there are 2 names in it:

 

Name 1

Name 2

 

Now Name 1 has 4 products for it in categories_name_3

and Name 2 has 5 products for it in categories_name_3

 

I want to be able when they click Name 1 that only the products under the Name 1 categorie show up and the ones for Name 2 do not show up unless that one is selected.

 

and the same has to go for the other drop downs too.

 

but also when the last (categories_name_4) product is selected it will send it to the same page that is linked to in the database like the way the categories box works when you click the link.

 

It sounds a little confusing and im sure i didnt explain it the best way possible. but if anyone would help me i would love it

Link to comment
Share on other sites

ok well im trying to get this done myself but i think i am stuck:

this is what i have so far, it loads the main categories but i dont want them to load i want the next level categories to be loaded. you can view it at www.streetflossin.com

 

after this drop down is working I need to make 2 more. it works kinda like the coolmenu i have to some aspect. When someone selctes the make in the first drop down, in the second one it will load the models to the one selcted in the first drop down. and the same for the 3rd drop down after the make and model are slected it will load the years that i have in the database for that model and after you select the year it will bring you to that page, same as if you clicked it in the categories menu. someone please help me

 

 

<?php
// copyright 2003 Street Flossin LLC.
?>
<!-- vehicle_search //-->
        <tr>
          <td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
                             'text'  => "Vehicle Search");
new infoBoxHeading($info_box_contents, false, false);

$vehicle_query= tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

// Display drop-down 1
  $select_box = '<select name="categories_id" onChange="this.form.submit();" size="' . MAX_MODEL_LIST . '" style="width: 100%">';
  if (MAX_MODEL_LIST < 2) {
    $select_box .= '<option value="">' . 'Vehicle Make' . '</option>';
  }

  while ($model_values = tep_db_fetch_array($vehicle_query))  {
   $select_box .='<option value="' . $model_values['categories_id'] = array('name' => $categories['categories_name'],
                                              'parent' => $model_values['parent_id'],
                                              'level' => 0,
                                              'path' => $new_path . '_' . $model_values['categories_id'],
                                              'next_id' => false) . '"';
    if ($HTTP_GET_VARS['categories_id'] == $model_values['categories_id']) {
  $select_box .= ' SELECTED';
$model_id = $model_values['categories_id'];
}
    $select_box .= '>' . $model_values['categories_name'] . '</option>';
  }
  $select_box .= "</select>";
  $select_box .= tep_hide_session_id();

  $info_box_contents = array();
  $info_box_contents[] = array('form'  => '<form name="vehiclemake" method="get/post" action="">',
                               'align' => 'left',
                               'text'  => $select_box);

new infoBox($info_box_contents);

?>
          </td>
        </tr>
<!-- vehicle_search_eof //-->

Link to comment
Share on other sites

  • 5 months later...

Archived

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

×
×
  • Create New...