poster Posted December 14, 2003 Posted December 14, 2003 Where do you modify the settings for the box in the center that says "New products for December". I would like to display two items per row and not three. Thanks
Guest Posted December 14, 2003 Posted December 14, 2003 catalog/includes/modules/new_products.php At or around line 36 is this: if ($col > 2) { Change it to 1 LESS than the number of items you want per row. col > 3 would you give you 4 per row col > 4 would give you 5 per row etc If you want 2 items per row, change the 2 to 1. Save and upload. hth
ScooterProShop.com Posted January 23, 2004 Posted January 23, 2004 On that same note ... what If I had a modified new_products.php and wanted to exactly the oposite? I only want 1 column per row. Here is the code: <?php $limit = 160; /* $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ ?> <!-- new_products //--> <?php if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select pd.products_id, pd.products_description, p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_id, pd.products_description, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } echo ' <table width="100%" border="0" cellspacing="0" cellpadding="0" class="greetinguser"> <tr> <td> <table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td> <table width="100%" border="0" cellspacing="1" cellpadding="1" class="greetinguserwhite"> <tr> <td><font size="2"><font color="#000000"><center><b>'.sprintf(TABLE_HEADING_NEW_PRODUCTS,'').'</center></font></b></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td>'; while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $products_description = $new_products['products_description']; $description_length = strlen($products_description); if ($description_length > $limit) { $products_description = substr($products_description,0,$limit) . ""; } echo ' <table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td width="50%" valign="top"><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1" class="greetinguserwhite"> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="ourtexthere" width="90%"><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></b></td> <td class="ourtexthere" align="right" width="10%"><font color="red"><b>'.$currencies->display_price($new_products['products_price'],tep_get_tax_rate($new_products['products_tax_class_id'])).'</b></font></td> </tr> </table> </td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td class="ourtexthere"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">'. tep_image(DIR_WS_IMAGES . $new_products['products_image'],$new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT). '</a></td> <td class="ourtexthere">'.$products_description.'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '"><font color="red">...Read More</font></a></td> </tr> <tr> <td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> </tr> </table></td>' ?> <?php $new_products = tep_db_fetch_array($new_products_query); $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $products_description = $new_products['products_description']; $description_length = strlen($products_description); if ($description_length > $limit) { $products_description = substr($products_description,0,$limit) . ""; } // if(empty($new_products['products_name'])) // { // exit; // }else{ if (empty($new_products['products_name'])){ echo ' <td width="50%" valign="top"> <table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="ourtexthere" width="90%"></td> <td class="ourtexthere" align="right" width="10%"></td> </tr> </table> </td> </tr> <tr> <td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> </tr> <tr> <td class="ourtexthere">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> <td class="ourtexthere">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> </tr> <tr> <td colspan="2" align="right">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> </tr> <tr> <td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> </tr> </table></td> </tr> </table>'; } else{ ?> <?php echo ' <td width="50%" valign="top"><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1" class="greetinguserwhite"> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="ourtexthere" width="90%"><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></b></td> <td class="ourtexthere" align="right" width="10%"><font color="red"><b>'.$currencies->display_price($new_products['products_price'],tep_get_tax_rate($new_products['products_tax_class_id'])).'</b></font></td> </tr> </table> </td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td class="ourtexthere"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">'. tep_image(DIR_WS_IMAGES . $new_products['products_image'],$new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT). '</a></td> <td class="ourtexthere">'.$products_description.'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '"><font color="red">...Read More</font></a></td> </tr> <tr> <td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td> </tr> </table></td> </tr> </table>'; } } echo '</td> </tr> </table>'; ?> <!-- new_products_eof //--> I tried almost everything to get 1 column ... no luck. I am just no that good at php. Scooterboy
Recommended Posts
Archived
This topic is now archived and is closed to further replies.