Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

products count in side menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-15-2008, 10:00 PM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Question products count in side menu

hi i m newbie to xcart. i like to add products count in side menu ie in categories.
Like this
Categories1 (23)
Categories2 (32)...
how to do this..and is it possible..
i need some help from u people..




thnks in advance..
Reply With Quote
  #2  
Old 05-16-2008, 12:53 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: products count in side menu

Quote:
Originally Posted by Vetrivel
hi i m newbie to xcart. i like to add products count in side menu ie in categories.
Like this
Categories1 (23)
Categories2 (32)...
how to do this..and is it possible..
i need some help from u people..

thnks in advance..

1. Back up file "skin1/customer/categories.tpl"

2.Replace the contents of the file, 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=$categories item=c}
<
font class="CategoriesList"><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
Reply With Quote
  #3  
Old 05-16-2008, 01:23 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Red face Re: products count in side menu

thnks Yurij

with the help of your reply i got it.

and one more thing that how to display the sub categories in the side menu bar while selecting the categories item ..
ex:
categories 1
sub-categories 1
sub-categories 2
sub-categories 3
categories 2
sub-categories 1
sub-categories 2
...........................
like this....
which file i need to touch ...


thnks in advance....
Reply With Quote
  #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
  #5  
Old 05-16-2008, 05:00 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default Re: products count in side menu

thanks Yurij...
.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:24 AM.

   

 
X-Cart forums © 2001-2020