View Single Post
  #2  
Old 03-15-2010, 07:52 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Hiding subcategories when they don't have products

{foreach from=$subcategories item=subcategory}
{if $subcategory.product_count > 0}
<div class="subcategories" style="min-width: {$subcat_div_width}px; width: {$subcat_div_width}px; height: {$subcat_div_height}px; min-height: {$subcat_div_height}px;">
{if $subcategory.is_icon}
<a href="home.php?cat={$subcategory.categoryid}"><img src="{$subcategory.icon_url|amp}" alt="{$subcategory.category|escape}" width="{$subcategory.image_x}" height="{$subcategory.image_y}" /></a>
{else}
<img src="{$ImagesDir}/spacer.gif" alt="" width="1" height="{$subcat_img_height}" />
{/if}
<br />
<a href="home.php?cat={$subcategory.categoryid}">{$su bcategory.category|escape}</a><br />
{if $config.Appearance.count_products eq "Y"}
{if $subcategory.product_count}
{$subcategory.product_count} {$lng.lbl_products|lower}
{elseif $subcategory.subcategory_count}
{$subcategory.subcategory_count } {$lng.lbl_categories|lower}
{/if}
{/if}
</div>
{/if}
{/foreach}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote