Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help please someone who knows...


daveboyle99

Recommended Posts

I've made a custom box to go in my lefthand column, the script goes like this

<?php
/*
 $Id: manufacturers.php,v 1.19 2003/06/09 22:17:13 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $manufacturers_query = tep_db_query("select type_id, type_name from " . TABLE_TYPE . " order by type_name");
 if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
?>
<!-- product types //-->
         <tr>
           <td>

<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

   new infoBoxHeading($info_box_contents, false, false);

   if ($number_of_rows <= 25) {
// Display a list
     $manufacturers_list = '';
     while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
       $type_name = ((strlen($manufacturers['type_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['type_name'], 
 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['type_name']);
       if (isset($HTTP_GET_VARS['type_id']) && ($HTTP_GET_VARS['type_id'] == $manufacturers['type_id'])) $type_name = '<b>' . 
 $type_name .'</b>';
       $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'type_id=' . $manufacturers['type_id']) . '">' . $type_name . 
 '</a><br>';
     }

     $manufacturers_list = substr($manufacturers_list, 0, -4);

     $info_box_contents = array();
     $info_box_contents[] = array('text' => $manufacturers_list);
   } else {
// Display a drop-down
     $manufacturers_array = array();
     if (MAX_MANUFACTURERS_LIST < 2) {
       $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
     }

     while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
       $type_name = ((strlen($manufacturers['type_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['type_name'], 
 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['type_name']);
       $manufacturers_array[] = array('id' => $manufacturers['type_id'],
                                      'text' => $type_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('type_id', $manufacturers_array, (isset($HTTP_GET_VARS['type_id']) ? 
          $HTTP_GET_VARS['type_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') 
          . tep_hide_session_id());
   }

   new infoBox($info_box_contents);
?>

<!-- product types_eof //-->
<?php
 }
?>

 

I have duplicated the 'manufacturers' and 'manufactrurers_info' tables and made the changes necessary, now when I hover over the product types in my new box I get the links showing like this

 

http://localhost/index.php?type_id=4&osCsi...caf68a542bf2198

 

so all seems good so far. The links also go bold when clicked to indicate that they have been selected. The problem is that nothing changes in the main section of the page when I click these links, I dont get the "no products to list in this category" page.

 

Could someone advise me as per the adjustments needed to get this going as I can't give up now. I've a feeleing that index.php and application_top.php might be the files that need adding to...

 

thanks in advance.

 

Dave.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...