Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

customising product listing


Guest

Recommended Posts

Posted

Hi

 

Sorry if this has been covered, but I've tried searching and didn't come up with anything that helped me. Please push me in the right direction if there is an article on my problem!

 

I'm stuck on customising the layout of the product listing. Basically, I just want to stick another table row in between each product in which I can put an image of a line, to split things up.. looking at the resultant code generated by oscommerce I want to put another row in between the following lines

 

  
</tr>
<tr class="productListing-odd">

 

However, I can't find in the code where it writes these lines. Can anyone help? Also, because my extra row is only going to have one cell in order to contain the line.gif image, I'm going to have to colspan it. Is there a variable hanging around to grab with number of columns from?

 

thanks

 

Dave

Posted

no one any idea how I do this?

 

thanks

 

Dave

Posted

Please backup your file first...

 

In includes/modules/product_listing.php

 

Find this code (near line 137)

 

$list_box_contents[$cur_row][] = array('align' => $lc_align,
										   'params' => class="productListing-data"',
										   'text'  => $lc_text);
  }
 }

 

And put this after the FIRST curly bracket shown above..

 

$list_box_contents[][] = array(
	   'params' => 'valign="middle" colspan="3"',
	   'text'  => '<tr><td colspan="3">' . tep_draw_separator('pixel_gray.gif', '100%', '2') . '</td></tr>' );

 

So all together, it looks like this

 

$list_box_contents[$cur_row][] = array('align' => $lc_align,
										   'params' => 'valign= "middle" class="productListing-data"',
										   'text'  => $lc_text);
  }
	$list_box_contents[][] = array(
	   'params' => 'valign="middle" colspan="3"',
	   'text'  => '<tr><td colspan="3">' . tep_draw_separator('pixel_gray.gif', '100%', '2') . '</td></tr>' );
}

 

That makes a grey line. There's a pixel_black.gif in your /images/ folder too, if you prefer that. <hr> would work too, I guess...

 

I never looked at making the colspan a variable, but I'm sure it's fairly straightforward. Since that never changes unless I want it to, I didn't worry about it. Mine is "colspan="3"" but you can change that to match your store.

 

You might want some padding on the cell...or else you can add a pixel_trans.gif on either side of the grey one, on the 'text' line.

Archived

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

×
×
  • Create New...