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

Category count figure on root category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-25-2003, 10:14 PM
 
srv07 srv07 is offline
 

Newbie
  
Join Date: May 2003
Posts: 4
 

Default Category count figure on root category

Hi All,
Just installing X-Cart and have been customising a few things.

I would like to ask how to have a count of how many products are inside a category or sub-category instead of how many catgories which doesn't really help anyone at all. The way X-Cart comes as default you can spend your whole day clicking on empty categories which is very user-friendly.

So I would like to have in my categories in the sidebar menu and in the sub-category menu that comes up when you click on those categories:

Category 1 (23)
Category 2 (14)
Category 3 (9)

and so on. So the figure in brackets is a total count of everything within that root category even if it has a another 5 levels inside it.....rather than it saying that it has "5 Categories".

Also would like to know how I fix it saying "1 Categories" and "1 Products". I can't for the life of me find where it is comign from.

TIA
J
Reply With Quote
  #2  
Old 09-25-2003, 10:37 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Put

{ $categories[cat_num].product_count}

where you want the product count to appear in categories.tpl

so in your example it would be:

Code:
{capture name=menu} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} <font class=CategoriesList>{ $categories[cat_num].category_name|escape }({ $categories[cat_num].product_count})</font> {/section} {else} {section name=cat_num loop=$subcategories} <font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font> {/section} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 09-25-2003, 10:49 PM
 
srv07 srv07 is offline
 

Newbie
  
Join Date: May 2003
Posts: 4
 

Default

Thanks for your help but I tried it and it doesn;t work....just shows (0) on every category

Any suggestions?

Thanks again
J
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 11:40 AM.

   

 
X-Cart forums © 2001-2020