View Single Post
  #4  
Old 05-16-2008, 04:30 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: products count in side menu

Well, I do not know how many good solution, try to do so:

1. Edit file "include/categories.php", add the end of the file the following code:

PHP Code:
$sql "SELECT * FROM ".$sql_tbl[categories]." WHERE avail='Y' ORDER BY categoryid_path";
$result func_query($sql);
$smarty->assign("allcats"$result); 

2. Replace the contents of the file ""skin1/customer/categories.tpl"", with this code:

PHP Code:
{* $Idcategories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{
capture name=menu}
{if 
$active_modules.Fancy_Categories ne ""}
{include 
file="modules/Fancy_Categories/categories.tpl"}
{
assign var="fc_cellpadding" value="0"}
{else}
{if 
$config.General.root_categories eq "Y"}
{foreach 
from=$allcats item=c}
{if 
$c.categoryid_path|count_characters gt 3}
    {
assign var="leftpdd" value=1}
{else}
    {
assign var="leftpdd" value=0}
{/if}
{if 
$leftpdd eq 0}<br />{/if}
<
font class="CategoriesList"> {if $leftpdd ne 0}&nbsp;- 
{/if}<
a href="home.php?cat={$c.categoryid}class="VertMenuItems">{$c.category} ({$c.product_count})</a></font><br />
{/foreach}
{else} {foreach 
from=$subcategories item=c key=catid}
<
font class="CategoriesList"><a href="home.php?cat={$catid}class="VertMenuItems">{$c.category}  ({$c.product_count})</a></font><br />
{/foreach}
{/if}
{/if}
{/
capture}
{ include 
file="menu.tpl" images_src="categories.gif" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding


This is useful for categories up to the second level of nesting.

In the same category are not sorted (the fields order by, and alphabetical order)
Reply With Quote