Transition Posted September 9, 2004 Share Posted September 9, 2004 Hello everyone, I'm searching throught the contributions looking for something that would allow me to take all of my product categories and display them on the main page w/ a thumbnail. I haven't had any luck locating a contribution as described and i think i've wore out the search button ;) . Any help is greatly apprecited, - RJ Link to comment Share on other sites More sharing options...
Guest Posted September 9, 2004 Share Posted September 9, 2004 Here you go... Rename (and save as a backup) includes/modules/new_products.php Copy the following into a blank Notepad file and save as includes/modules/new_products.php Then upload the new version. <?php /* $Id: new_products.php,v 1.33 2003/02/12 23:55:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- new_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => "Main Catagories"); new contentBoxHeading($info_box_contents); $new_products_query = tep_db_query("SELECT `categories`.`categories_id` , `categories`.`categories_image` , `categories_description`.`categories_name` FROM categories, categories_description WHERE `categories`.`categories_id` = `categories_description`.`categories_id` AND `categories`.`parent_id` = 0 order by `sort_order`"); $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $new_products['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['categories_image'], $new_products['categories_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $new_products['categories_id']) . ' ">' . $new_products['categories_name'] . '</a><br>'); $col ++; if ($col > 2) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- new_products_eof //--> :D Link to comment Share on other sites More sharing options...
Transition Posted September 9, 2004 Author Share Posted September 9, 2004 Thanks x 1,000,000 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.