12
Ghai thanks for the information. I believe that is exactly what I am trying to do but I will be honest I am having a difficult time translating the example over into my code.
So far I have gotten the categories to all display however for each category it is displaying all the products for all categories.
Here is a copy of my updated code
Now there is a value of $prod.catid which is the same as $cat.id also there is $prod.catname that is the same as $cat.name I am just not sure how to connect the dots correctly in the smarty.
<table>
<tr>
<{foreach item=cat from=$lcats}>
<td>
<center><DIV><SPAN style="FONT-SIZE: 24pt; COLOR: #bcb947; FONT-FAMILY: 'Bernard MT Condensed'; language: en-US"><{$cat.name}></SPAN></DIV></center>
</td>
</tr>
<tr>
<td>
<table class="item">
<tr>
<{foreach item=prod key=count from=$allprod}>
<td style='margin:0px;padding:5px 0px;'>
<table><tr><td>
<DIV><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 14pt; COLOR: #bcb947; FONT-FAMILY: Constantia; language: en-US"><{$prod.p_name}></SPAN></DIV>
<br />
<DIV><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #bcb947; FONT-FAMILY: Constantia; language: en-US"><{$prod.p_desc_long}></SPAN></DIV>
</td>
<td align="right"><{if $spec.special eq 1}>
<span style="text-decoration:line-through; color:#FF0000">$<{$prod.p_price}></span><br />$<{$prod.p_sp_price}>
<{else}>
<DIV><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #bcb947; FONT-FAMILY: Constantia; language: en-US">$<{$prod.p_price}></SPAN></DIV>
<{/if}>
</span>
<br />
<form method="post" action="add_to_cart.php?id=<{$prod.id}>">
<input type="text" name="qty" value="1" size="3" maxlength="4" title="quantity">
<br />
<input type="submit" value="AddToCart">
</form>
</td>
</tr></table>
</td>
<{if $count is div by $colnum}>
</tr>
<tr>
<{/if}>
<{/foreach}>
</tr>
</table>
</td><tr>
<{/foreach}>
<br />
</tr>
</table>
For the most part this code does exactly what I want it to do however if I could get some help getting it to only list the products for the associated category you would be a life saver.
Thanks!