View Single Post
  #14  
Old 06-24-2005, 07:39 AM
 
mattzarb mattzarb is offline
 

Member
  
Join Date: Aug 2003
Location: Manassas, VA
Posts: 29
 

Default

I found this some problem, and it seems like the products.tpl template lost some functionality somewhere.

I looked back at a copy of the file on a 3.4.x version of a store I have running, and products.tpl was set up to check the appropriate configuration settings and include products_t.tpl if needed, otherwise it would display a single column product list.

I'm working on a 4.0.14 cart right now and see that the products.tpl template has no code at all to even check the $featured variable or any config settings. It will always display everything in a 2 column format.

Trying to find where products_t.tpl went, I see that this is now only called from cart_contents.tpl and cart_details.tpl.

So....

If you want to "fix" products.tpl to actually pay attention to the configuration settings the way it used to, add this to the top of the products.tpl:
Code:
{if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products} {else} [ .. original products.tpl content ] {/if}

There are a couple of things to consider on this fix:

1. The original products.tpl inside the {else}{/if} will still be configured to always display in 2 columns. If you want it to default to 1 column (the way it used to be) then you'll need to edit that part of the template.

2. products_t.tpl by default will not display product descriptions. So if you want your products list to appear the way they do in products.tpl, only with variable columns, you'll need to either modify products_t.tpl (which will have side effects in the cart view) or hack products.tpl to include much the same code as in products_t.tpl

I think I'll be hacking a version of products.tpl to abide by the settings instead of calling products_t.tpl so if you're interested in this let me know. I'm also making this a pure css (w/o table) implementation, so I'd need to create another version of the template for the more standard table implementation if anyone wants it.

Matt
__________________
Matt Zarbatany
AITG Inc.
http://www.aitg.com/
X-Cart version 4.0.18
Reply With Quote