Code: Select all
{assign var='number' value=1}
{foreach from=$items item=entry}
{if isset($entry->categories)}
{foreach from=$entry->categories item='category'}
{if $number == 1}
<h3>{$category->name}</h3>
{/if}
{assign var='number' value=2}
{/foreach}
{/if}
{/foreach}
{foreach from=$items item=entry key=key}
{*
the summary template has access to custom fields via the $entry->fields hash
and to categories via the $entry->categories array of objects. Also
attribute information is available via $entry->attributes.
you should use the get_template_vars and the print_r modifier to see
what is available
*}
{capture name="column"}{math equation="x % 3" x=$key}{/capture}
{if $smarty.capture.column == "0"}
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="33%" align="center" valign="middle">
{foreach from=$entry->fields key='name' item='field'}
{if $field->type == 'image' && isset($field->thumbnail)}
<a href="{$entry->detail_url}"><img src="{$entry->file_location}/{$field->thumbnail}" alt="{$field->value}" border="0"/></a>
{/if}
{/foreach}
<br />
<a href="{$entry->detail_url}">{$entry->product_name}</a>
</br />
Price: {$currency_symbol}{$entry->price|number_format:2}
{* include the cart *}
{if isset($cart_module_tag)}
{eval var=$cart_module_tag}
{/if}
</td>
{elseif $smarty.capture.column == "1"}
<td width="33%" align="center" valign="middle">
{foreach from=$entry->fields key='name' item='field'}
{if $field->type == 'image' && isset($field->thumbnail)}
<a href="{$entry->detail_url}"><img src="{$entry->file_location}/{$field->thumbnail}" alt="{$field->value}" border="0"/></a>
{/if}
{/foreach}
<br />
<a href="{$entry->detail_url}">{$entry->product_name}</a>
</br />
Price: {$currency_symbol}{$entry->price|number_format:2}
{* include the cart *}
{if isset($cart_module_tag)}
{eval var=$cart_module_tag}
{/if}
</td>
{elseif $smarty.capture.column == "2"}
<td width="33%" align="center" valign="middle">
{foreach from=$entry->fields key='name' item='field'}
{if $field->type == 'image' && isset($field->thumbnail)}
<a href="{$entry->detail_url}"><img src="{$entry->file_location}/{$field->thumbnail}" alt="{$field->value}" border="0"/></a>
{/if}
{/foreach}
<br />
<a href="{$entry->detail_url}">{$entry->product_name}</a>
</br />
Price: {$currency_symbol}{$entry->price|number_format:2}
{* include the cart *}
{if isset($cart_module_tag)}
{eval var=$cart_module_tag}
{/if}
</td>
</tr>
<tr colspan="3" height="20"></tr>
</table>
{/if}
{/foreach}
{if $smarty.capture.column != 2}
<!-- Close the table! -->
</tr></table>
{/if}