sawfish62 Posted June 10, 2005 Share Posted June 10, 2005 Would it be possible to have a box on the left with icons of various manufacturers, so that if you clicked on one all their products would appear on the page, instead of the dropdown list with manufacturers names that's there at the moment? thanks again Link to comment Share on other sites More sharing options...
Wendy James Posted June 10, 2005 Share Posted June 10, 2005 I believe (although I could be wrong) that when you enter the manufacturers name you can use html so it shows images. I know this works for the categories. So instead of typing in osCommerce you could put something like <img src="urltothepic/folder/oscommerce.jpg"> I haven't tried it so I could be way off, but I have tried it with the categories and it worked for me. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
sawfish62 Posted June 13, 2005 Author Share Posted June 13, 2005 I believe (although I could be wrong) that when you enter the manufacturers name you can use html so it shows images. I know this works for the categories. So instead of typing in osCommerce you could put something like <img src="urltothepic/folder/oscommerce.jpg"> I haven't tried it so I could be way off, but I have tried it with the categories and it worked for me. <{POST_SNAPBACK}> Could you tell me where to put this code? Is it through the admin panel or on a php page? thank you Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 13, 2005 Share Posted June 13, 2005 Could you tell me where to put this code? Is it through the admin panel or on a php page? thank you <{POST_SNAPBACK}> Instead of filling the pulldown with values from the DB in the manufacturers box, I'd remove the pulldown, and fill a string with the links /cherck out what the link has to look like by saving the one right now) and images to shown, right next to each other or separated with breaks like you need it, and then call that string in the box :-) Monika original code // 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); ?> </td> </tr> <!-- manufacturers_eof //--> <?php } ?> :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
sawfish62 Posted June 13, 2005 Author Share Posted June 13, 2005 Instead of filling the pulldown with values from the DB in the manufacturers box, I'd remove the pulldown, and fill a string with the links /cherck out what the link has to look like by saving the one right now) and images to shown, right next to each other or separated with breaks like you need it, and then call that string in the box :-) Monika original code // 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); ?> </td> </tr> <!-- manufacturers_eof //--> <?php } ?> <{POST_SNAPBACK}> Thanks for the reply Monika but this is all a bit beyond me. I dont suppose you could simplify it a bit for a a novice? I dont even know which php page to edit, or indeed if I need too? thanks Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 13, 2005 Share Posted June 13, 2005 Thanks for the reply Monika but this is all a bit beyond me. I dont suppose you could simplify it a bit for a a novice? I dont even know which php page to edit, or indeed if I need too? thanks <{POST_SNAPBACK}> I understand. I will try it out and if it works I'll post the code for you, ok? :- Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 13, 2005 Share Posted June 13, 2005 http://www.noahsark4kids.com/test/ go to catalog/includes/boxes/manufacturers.php, backup your file and then replace the text there with this 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 (c) 2003 osCommerce Released under the GNU General Public License */ $manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where m.manufacturers_id=p.manufacturers_id order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { ?> <!-- manufacturers //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS); new infoBoxHeading($info_box_contents, false, false); // 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']) . '">' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name'], '100') . '</a><br><br>'; } $manufacturers_list = substr($manufacturers_list, 0, -8); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $manufacturers_list); new infoBox($info_box_contents); ?> </td> </tr> <!-- manufacturers_eof //--> <?php } ?> HTH Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
sawfish62 Posted June 13, 2005 Author Share Posted June 13, 2005 http://www.noahsark4kids.com/test/ go to catalog/includes/boxes/manufacturers.php, backup your file and then replace the text there with this 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 (c) 2003 osCommerce Released under the GNU General Public License */ $manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where m.manufacturers_id=p.manufacturers_id order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { ?> <!-- manufacturers //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS); new infoBoxHeading($info_box_contents, false, false); // 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']) . '">' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name'], '100') . '</a><br><br>'; } $manufacturers_list = substr($manufacturers_list, 0, -8); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $manufacturers_list); new infoBox($info_box_contents); ?> </td> </tr> <!-- manufacturers_eof //--> <?php } ?> HTH Monika <{POST_SNAPBACK}> Works perfectly thank you. I'm going to try to decipher the code now so I can understand it. Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 13, 2005 Share Posted June 13, 2005 Works perfectly thank you. I'm going to try to decipher the code now so I can understand it. <{POST_SNAPBACK}> lol ... most of the code was already on the page, I just changed it a bit. Be sure to have your pics the correct size so they won't stretch (I set it at 100 here, you can change that). What I did I patsed them all onto transparent images, width 100px. :-) Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
sawfish62 Posted June 13, 2005 Author Share Posted June 13, 2005 lol ... most of the code was already on the page, I just changed it a bit. Be sure to have your pics the correct size so they won't stretch (I set it at 100 here, you can change that). What I did I patsed them all onto transparent images, width 100px. :-) Monika <{POST_SNAPBACK}> Funny you should say that, I was about to ask about it. Is there a way of making all the images show the actual size they are, instead of them all being 100 pixels? Or do I have to set each an individual size? Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 17, 2005 Share Posted June 17, 2005 Funny you should say that, I was about to ask about it. Is there a way of making all the images show the actual size they are, instead of them all being 100 pixels? Or do I have to set each an individual size? <{POST_SNAPBACK}> if you omit the number 100, and just leave the '', it will show the size uploaded. Be sure to have them sized correctly then though! :-) Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Wendy James Posted June 17, 2005 Share Posted June 17, 2005 Could you tell me where to put this code? Is it through the admin panel or on a php page? thank you <{POST_SNAPBACK}> In the admin area where you create new categories or enter the manufacturers. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.