Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing Header - defining cell width possible?


Supertex

Recommended Posts

I've figured out how to edit product_listing.php to define widths so that I have more room for the "Product Name" column in the actual product list, but the header doesn't line up, and I can't for the life of me find a way to do it.

 

I do know that it divides evenly, based on what criteria are set to show in admin>configuration>product listing, so I'm unsure just how difficult it would be to define the cell widths. I can't find anywhere to change existing code, so I'm assuming I'll have to add something somewhere.

 

The image is to further clarify the width I want to change.

 

ceexszp

 

Note how the price is more than twice the width required? I'd really like to make use of that space for the Product Name field.

 

If anyone has a solution for this, you'd have my gratitude.

 

k...gave up on the pic showing, but it's attached.

post-292008-0-34625800-1366928197_thumb.jpg

Link to comment
Share on other sites

In the product listing table you have to change the cell widths in 2 area's. ! in the tables header - where the heading you refer to are, and the other other in the tables body, where the content is output.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

@I've tried altering the code in includes/modules/product_info.php, in both the "top" section (~line40-75):

 

switch ($column_list[$col]) {
     case 'PRODUCT_LIST_MODEL':
         $lc_text = TABLE_HEADING_MODEL;
         $lc_align = 'right';
         break;
     case 'PRODUCT_LIST_NAME':
          $lc_text = TABLE_HEADING_PRODUCTS;
          $lc_align = 'right';
          $lc_width = '200';
          break;

 

And also below that in the section that defines the columns for the items (~108-118):

 

 break;
case 'PRODUCT_LIST_NAME':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td width = "200px"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
} else {
$prod_list_contents .= ' <td width = "200px"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
}
break; 

 

That does change the product name width in the list, but the header is unaffected. Is my syntax in the upper portion incorrect?

post-292008-0-96045200-1366988069_thumb.jpg

Link to comment
Share on other sites

It occurs to me, that I have to define something in line 81, in order for the header to recognize the edit.

 

Line 81:

 $prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . '>' . $lc_text . '</td>';

 

I think I'm trying to define width, but I don't see any "$lc_width" there to be defined.

 

I'm not a coder...I'm just intuitive enough to "kind of" understand what's happening (I think), and foolish enough to try different things out. Truthfully, I'm drowning in my own ignorance.

 

Am I mistaken in thinking that lines 40-75 handle the header?

Link to comment
Share on other sites

It occurs to me, that I have to define something in line 81, in order for the header to recognize the edit.

 

Right you are, create the new variable, $lc_width and add it like you already did,

case 'PRODUCT_LIST_NAME':
			   $lc_text = TABLE_HEADING_PRODUCTS;
			   $lc_align = 'right';
			   $lc_width = '200px';
			   break;

 

and then add it to the heading output:

$prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . (tep_not_null($lc_width) ? ' width="' . $lc_width . '"' : '' .'>' . $lc_text . '</td>';

 

* I added px to your width definition, you could instead add to the above snippet, but if you ever need to use % on one cell and px on another then your covered.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Link to comment
Share on other sites

Found it:

$lc_width . '"' : '') .'>' . $lc_text . '</td>';

 

Was missing a closing ")" after width definition.

 

You sir are a scholar and a gentleman. Thank you, fellow Texan.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...