Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trying to change Product Listing layout


filteauf

Recommended Posts

Posted

I've seen this on a few sites but can't seem to find a contribution for this purpose. I want my product listing/category display (whatever you would call it when you display the contents of a category) to display the products in the category in a 3 x 4 table (3 wide), similar to how the new products box lists them.

 

I've accomplished the easy part of setting max-products per page to 12, but can't seem to locate the code that produces <tr><td>image</td><td>name</td><td>price</td></tr> for each product in the default list style view.

Posted

I have a slightly similar question. I want to have two columns. The left-most column holds the image and the right column holds

 

<td>

name<br>

price<br>

description<br>

buy now

</td>

 

I am hoping I can manipulate this in the admin, but it does not look like it. I was looking into the product with columns contribution, but I actually still only want one row (and two columns) per product. Sorry for the newbie question, but I am trying hard not to have to rewrite more php files than absolutely necessary!

Posted

As for:

 

Could you please tell me, how did you get to setting max-products per page to 12 ?

It's in the admin under configuration, maximums. They call it 'Search results', took me a while and some testing to realize that they consider displaying a category contents as a search, not just the advanced search.

 

I'll look at that contribution and see if it works out like I want with that. Thanks!

 

 

For this, it might not be the cleanest thing to do but I just tested a bit this is how I'd approach this request. Make sure to do backups in case it falls apart completely:

 

<td>

name<br>

price<br>

description<br>

buy now

</td>

 

in /modules/product_listing.php in the second switch($column_list[$col]) change the case 'PRODUCT_LIST_NAME' to concatenate (the $lctext .= $whatever, not sure of the appropriate name for it in PHP) the name (already there), the price, the description, and the buy now. I'm not too sure where to pull the description information from, but if I get a chance later I'll play with it a bit and try to give you some code answers.

 

Next would be in index.php, change the switch() statement that sends stores info in the string $listing_sql so that the case PRODUCT_LIST_NAME also generates the same information. Then disable the columns in the admin tool, and redefine TABLE_HEADING_PRODUCTS (still looking for it again) to whatever you want displayed at the top of the column.

 

I haven't tested all these changes yet, so PLEASE backup the files first, the only part I've tested is adding text in modules/product_listing.php under the case PRODUCT_LIST_NAME and it shows up for me.

Posted

Thank you! I will try to follow the steps you describe, hope I will be able to get it.

Posted
As for:

 

For this, it might not be the cleanest thing to do but I just tested a bit this is how I'd approach this request. Make sure to do backups in case it falls apart completely:

 

<td>

name<br>

price<br>

description<br>

buy now

</td>

 

<snip>

This worked brilliantly and saved me hours of time digging. I really appreciate your kind help. Thanks!

Archived

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

×
×
  • Create New...