Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product_listing.php


SirNicholas

Recommended Posts

The product_listing.php file in the modules directory looks like the table is dynamically created when displaying the products.

 

How would I go about setting a column width?

I'd like to force the columns to be specific widths instead of the width being determined by the data.

 

Any help or direction would be great...

Thanks,

Ant

Link to comment
Share on other sites

The product_listing.php file in the modules directory looks like the table is dynamically created when displaying the products.

 

How would I go about setting a column width?

I'd like to force the columns to be specific widths instead of the width being determined by the data.

 

Any help or direction would be great...

Thanks,

Ant

Hi Ant,

 

in your product_listing.php. you need to introduce a new parameter for width.

Important: add the new parameter to each column, or the value of the column displayed next to it will be reused till there is a new value for override.

 

here are the modifications in bold (you need to add the parameter to each!!!)

 

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

$lc_width = '300';

 

if (tep_get_topcategory_id($listing['products_id']) != SHOWROOM_TOPCAT_ID) {

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>?';

} else {

$lc_text = '?';

}

break;

}

 

$list_box_contents[$cur_row][] = array('align' => $lc_align,

'params' => 'class="productListing-data" width="' . $lc_width . '"',

'text' => $lc_text);

}

}

 

new productListingBox($list_box_contents);

:-)

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

yvw ... I just saw that the unbolded part of my code was not vanilla, but I hope it didn't confuse you.

:-)

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

Archived

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

×
×
  • Create New...