Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing the Index Grid and including a description field in the category listing...


Snowy_River

Recommended Posts

Hello,

 

I'm trying to figure out how to change the grid on the index page. Right now, it is three wide and however-many tall. I want to make it two wide, so that I can use larger product images without the images pushing out past the edge of the the layout.

 

Also, I'd like to be able to include some kind of description field on the product listing pages when a category is selected. Right now, there is only the product image, product name and the price. Having a short description, ideally under the name, would be fantastic.

 

Any help on these two points would be fantastic.

 

Thanks!

Link to comment
Share on other sites

Looking at

 

if ($num_new_products > 0) {
$counter = 0;
$col = 0;
$new_prods_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">';
while ($new_products = tep_db_fetch_array($new_products_query)) {
 $counter++;
 if ($col === 0) {
 $new_prods_content .= '<tr>';
 }
 $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>';
 $col ++;
 if (($col > 2) || ($counter == $num_new_products)) {
 $new_prods_content .= '</tr>';
 $col = 0;
 }
}

 

in

 

includes/modules/new_products.php

 

it would be helpful to change

 

width="33%"

 

to

 

width="50%"

 

and

 

if (($col > 2) || ($counter == $num_new_products)) {

 

to

 

if (($col > 1) || ($counter == $num_new_products)) {

 

The default value of

 

admin > Configuration > Maximum Values > New Products Module

 

is 9. But you may want to change it to a number that is a multiple of 2, instead of a multiple of 3.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...