Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

change manufacturer pull down menu to list


Idult

Recommended Posts

In includes/boxes/manufacturers.php, change

      $manufacturers_array = array();
     if (MAX_MANUFACTURERS_LIST < 2) {
       $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
     }

     while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
       $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
       $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
                                      'text' => $manufacturers_name);
     }

     $info_box_contents = array();
     $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
                                  'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());

to

      $manufacturers_array = array();
     while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
       $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
       $manufacturers_array[] = '<a href=" . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '">' .  $manufacturers_name . '</a>';
     }
     $info_box_contents = array();
     $info_box_contents[] = array('align' => 'left',
                                  'text' => implode('<br>', $manufacturers_array));

You may have to play with this a bit to get the exact effect that you want.

 

Hth,

Matt

Link to comment
Share on other sites

got an error

 

Parse error: parse error in /home/public_html/catalog/includes/boxes/manufacturers.php on line 39

 

this is line 39:

$manufacturers_array[] = '<a href=" . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '">' . $manufacturers_name . '</a>';

Link to comment
Share on other sites

Sorry, I forgot a ' and a )

$manufacturers_array[] = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a>';

should work better.

 

Hth,

Matt

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...