X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Category count figure on root category (https://forum.x-cart.com/showthread.php?t=4496)

srv07 09-25-2003 10:14 PM

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

funkydunk 09-25-2003 10:37 PM

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 }


srv07 09-25-2003 10:49 PM

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

Any suggestions?

Thanks again
J


All times are GMT -8. The time now is 10:59 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.