View Single Post
  #6  
Old 09-27-2011, 01:55 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: help with products_list.tpl problem, repeating product?

What you are asking for is not easy, the question seems simple, but the answer might take pages of text to explain to someone new. Let me try to shed some light on why what you did didn't work, and that should help you figure out how to make it work.

See this:
{foreach from=$products item=product name=products}--starts an array loop through the items.

So anything called inside this like {$product.productcode|escape} will spit out the current product code for this iteration of the loop.

{/foreach}--Ends the loop.

So to do what you want (This is an example not actual code)
Code:
<tr> {foreach from=$products item=product name=products} <td>{$product.productcode|escape}</td> {/foreach} </tr>

The problem with this mindset, is it doesn't allow for starting another row. What if you had 10 products, or 100?

What I directed you to before "Number of columns to display the product list" should activate a template called products_t.tpl. take a look at this to see how a properly formatted table with multiple columns is handled.

I think you are only struggling with this due to template customizations.

Perhaps you should switch templates back to a default one, just to observe the behavior of multi-column formatting of products, as controlled by the number of columns setting in the admin. I don't think any designer should have interfered with this basic functionality when building the template.

I know this probably raises more questions than it answers...but hopefully some of it makes sense.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote