stephena Posted September 21, 2006 Posted September 21, 2006 I think i posted this in the wrong thread before and got no reply.... I am trying to move the drop down menu on the left hand site of the default OScommerce cart. I have borrowed the code from the boxes/manufacturers.php and i am trying to remove the formatting so that all i have is the drop down box, no border, no background, just the drop down menu. I am fairly new to PHP and very new to OScommerce so be gentle with me. Here's my code so far: CODE<?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 © 2003 osCommerce Released under the GNU General Public License */ $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { ?> <!-- manufacturers //--> <?php //$info_box_contents = array(); //$info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS); //new infoBoxHeading($info_box_contents, false, false); if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) { // Display a list $manufacturers_list = ''; 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']); if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>'; $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a>'; } $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)) { $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()); } new infoBox($info_box_contents); ?> <!-- manufacturers_eof //--> <?php } ?> Bascially which lines should i strip out from the above? Thanks in advance
natewlew Posted September 21, 2006 Posted September 21, 2006 It is hard for me to see what you are doing. I took my own manufacturers.php and removed it from the box and I put it in a table. But I couldn't get onChange="this.form.submit(); to display in my page source. When I selected a manufacturer it did nothing so I added a submit button. Thats all I could do so far. Have a look at my code and see what you can do with it. What I did was, I pulled the information out of an array so it will dispay on the page(best I can do). http://www.shiplinux.com/extra/manufacturers.php.txt Other great Open Source (Free) programs: (Free as in free speech not free beer) The Gimp - An image program. | Firefox - All you have to do is add the Web Developer add-on to make this web browser complete. | FileZilla - An ftp program. | Inkscape - A good program to create images with. | Thunderbird - An email program. | Openoffice.org - An office suite that is compatible with MS Office. | Abiword - Another office suite. | Audacity - A sound recording tool. | ddp's Picks | Wordpress - An easy to use blogging software. | Joomla - An easy to use CMS that has ecommerce plug-ins. | Drupal - Another CMS How do I find these programs? Google Search!
stephena Posted September 21, 2006 Author Posted September 21, 2006 Just what i was looking for thankyou!!!!
stephena Posted September 22, 2006 Author Posted September 22, 2006 I am trying to the same with the search box (last one i promise) i have tried to adapt the code as you did for the manufacturers menu but i am still unable to remove the box style around the form. Any guidance greatly appreciated
natewlew Posted September 22, 2006 Posted September 22, 2006 You almost have to comment out everything. You have to pull the information out of the $info_box_contents array and format it to echo. Otherwise the "new infoBox($info_box_contents);" will format it to display in a box. I don't know if that will make sense to you. http://www.shiplinux.com/extra/search.php.txt Other great Open Source (Free) programs: (Free as in free speech not free beer) The Gimp - An image program. | Firefox - All you have to do is add the Web Developer add-on to make this web browser complete. | FileZilla - An ftp program. | Inkscape - A good program to create images with. | Thunderbird - An email program. | Openoffice.org - An office suite that is compatible with MS Office. | Abiword - Another office suite. | Audacity - A sound recording tool. | ddp's Picks | Wordpress - An easy to use blogging software. | Joomla - An easy to use CMS that has ecommerce plug-ins. | Drupal - Another CMS How do I find these programs? Google Search!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.