Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   display in () how many items in category and sub category (/showthread.php?t=10464)

yankeestonk April 8th, 2014 10:28 AM

display in () how many items in category and sub category
 
Is there a way to display in ( )'s next to each category and each sub category how many items total are in the respective category? Like they do here. http://www.pricegrabber.com/sporting...-bags/p-1647/#

stefan April 8th, 2014 11:28 AM

You can use the following shortcode in your categories widget view WIDGETS > Categories > Category list > :

[category.pc] = current category's product count

yankeestonk April 8th, 2014 02:23 PM

Could you show me exactly how to place it? here is the code I have now.

[category.list before='<ul>' after='</ul>']

[category.if active="self"]
<li class="active">
[category.name]
[category.repeat]
</li>
[/category.if]

[category.if active="child"]
<li>
<a href="[category.link]" title="[category.name]">[category.name]</a>
[category.repeat]
</li>
[/category.if]

[category.if active="parent"]
<li>
<a href="[category.link]" title="[category.name]">[category.name]</a>
</li>
[/category.if]

[category.if active="no"]
<li>
<a href="[category.link]" title="[category.name]">[category.name]</a>
</li>
[/category.if]

[/category.list]

stefan April 8th, 2014 03:59 PM

Just add [category.pc] after each </a> tag like this

<a href="[category.link]" title="[category.name]">[category.name]</a> ([category.pc])

yankeestonk April 8th, 2014 04:25 PM

ok that worked ok but....

can I get it to show JUST the sub categories? As you can see on my homepage I don't have anything in the main categories. http://saveongolf.net .

looks good though!

stefan April 8th, 2014 04:43 PM

Quote:

Originally Posted by yankeestonk (Post 48367)
can I get it to show JUST the sub categories? As you can see on my homepage I don't have anything in the main categories. http://saveongolf.net .

In that case just add [category.pc] in the [category.if active="parent"] section.

yankeestonk April 8th, 2014 04:48 PM

you mean child right? I don't want it on the parent I believe.

forget above!...

check this out and let me know if there is a fix. http://saveongolf.net . In the categories go to "golf bags". When that opens there will be 3 sub categories that show (0) then when you click it shows how many of each brand. How can I get that (0) to show the sum of the childs below it...or....not show the (0) at all but still have the sub child show the numbers?

i have the same issue on the "hot list" categories up top too.

Thanks,
ken

yankeestonk April 8th, 2014 06:14 PM

meant to say "Could you....", didn't mean to sound bossy!

stefan April 8th, 2014 06:23 PM

Instead of [category.pc] try [category.pct]

[category.pct] = current category's product count + all sub-categories product count.


All times are GMT -5. The time now is 01:06 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.