Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Drop-down/pull-down product finder


siavash

Recommended Posts

Posted

hi all,

 

i need to have a pull-down menu for different prodcut categories. for instance my customers gotta be able to find from a drop-down list all products in a certain category (just like manufacturers drop-down). how can i do this using the available stuff in OSC. let me explain myself better:

 

i sell a mix of variety of products including projector lamps by different manufacturers. my customers need to be able to pull-down a menu listing all brands of lamps. selecting any of these will take them to a page that only projector lapms by that manufacturer is listed with attributes and "add to basket" or "buy now" button. clicking an item on the list will of course take them to the product info page. the problem is that when they go to the manufactueres page by using the pull down menu i don't want them to see other product by that manufacturer but lamps only.

 

how can i achive this?

 

any ideas?

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

anyone? any clues, tips?

 

thnx

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

'morning,

has anyone done this? any ideas?

i can imagine how it can be done but i'm not a programmer and have not clues how to realize this. your help will be appreciated.

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

hopefully someone has the answer to this, l am also looking for the same thing, please let me know also.

 

 

 

Thanks in advance guys :huh:

  • 4 weeks later...
Posted

Hello, I have been trying to acheive the same thing too!

however I have not installed the contribution mentioned but have modified the code.

It works fine displaying everything in the list.

But at the moment it goes to a list not the product page.

but there is a weird error!

If you select one product then select another it and so on. you start with 1 product in the list then 3 then 5 then 9 etc. So the more products you select through the product finder the more products displayed in the results page.

 

The first thing to fix which might also fix the later problem is to make it go straight to the product page.

 

Once this is fixed I can add it as a contribution,

Anyones help is very greatfully recived

 

the website is not live yet but is at www.world-class.co.uk/catalog

 

thanks

Peter

 

the code is

<?php
 }
?>
    
<?php
 new infoBox($info_box_contents, false, false);
 
 $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " order by products_name");
 if ($number_of_rows = tep_db_num_rows($products_query)) {
 ?>
<!-- products //-->
         
<?php


define('MAX_DISPLAY_PRODUCTS_IN_A_LIST',0);
define('MAX_DISPLAY_PRODUCT_NAME_LEN',50);
define('MAX_PRODUCTS_LIST',1);



// Display a drop-down
     $products_array = array();
  $products_array[] = array('id' => '', 'text' => AZ_PRODUCTS);

     while ($products = tep_db_fetch_array($products_query)) {
       $products_name = ((strlen($products['products_name']) > MAX_DISPLAY_PRODUCT_NAME_LEN) ? substr($products['products_name'], 0, MAX_DISPLAY_PRODUCT_NAME_LEN) . '..' : $products['products_name']);
       $products_array[] = array('id' => $products['products_id'],
                                      'text' => $products_name);
     }

     $info_box_contents = array();
     $info_box_contents[] = array('form' => tep_draw_form('products', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
                                  'text' => tep_draw_pull_down_menu('products_id', $products_array, (isset($HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_PRODUCTS_LIST . '" style="width: 100"') . tep_hide_session_id());


   new infoBox($info_box_contents);
}
?>
           </td>
         </tr>
<!-- products_eof //-->

Archived

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

×
×
  • Create New...