Guest Posted February 5, 2013 Posted February 5, 2013 Re osC 2.3.3. In admin page "Maximum Values" has these: The "Categories to List Per Row" can set the number of categories you like. The "New Products Listing" can set maximum number of new products to display in new products page, BUT cannot adjust the number of products per row (like the above). Is there anyway to change the number of products per row in the "New Products List" page? The default is 3 products per row, I want to change it to 2 products per row then I can set the product image bigger. Please help! Nicky
burt Posted February 5, 2013 Posted February 5, 2013 includes/modules/new_products.php Two places: 33% (change this to 100/cols), eg: if you want 2 columns 100/2 == 50 so you would change it to 50% if (($col > 2) (change this to 1 less than the number of columns. eg, if you want two columns, change to if (($col > 1) This should be an admin setting and I will add it onto my list of to-do's.
burt Posted February 5, 2013 Posted February 5, 2013 Find this: $new_prods_content .= '<td width="33%" align="center" valign="top"><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><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br />' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</td>'; Change to: $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $new_prods_content .= '<td width="' . $width . '" align="center" valign="top"><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><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br />' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</td>'; And find this: if (($col > 2) || ($counter == $num_new_products)) { Change to: if (($col > (MAX_DISPLAY_CATEGORIES_PER_ROW-1)) || ($counter == $num_new_products)) { Now the new products modules gives the same number of columns as the MAX_DISPLAY_CATEGORIES_PER_ROW setting.
Guest Posted February 5, 2013 Posted February 5, 2013 @@burt :thumbsup: Wonderful! It works like a charm, just as I wanted. I would suggest if you can further improve it by separating the number setting for Category per Row from Products per row, because if there are lots of categories in addition to the new products all line up in two column then the page became too long. It would be nice to have 4 categories per row for small thumbnails and 2 products per row for larger image. Thank you very much anyway. :) Have A Nice Day! P.S. I already got an ebook beginning to learn some php and sql - just want to handle the osCommerce better.
Guest Posted February 5, 2013 Posted February 5, 2013 @@burt :thumbsup: Wonderful! It works like a charm, just as I wanted. I would suggest if you can further improve it by separating the number setting for Category per Row from Products per row, because if there are lots of categories in addition to the new products all line up in two column then the page became too long. It would be nice to have 4 categories per row for small thumbnails and 2 products per row for larger image. I forgot to mention my further suggest is on the next down level Categories page only, the front index page looks fine just as I needed. Thanks again.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.