Keyword

k2item counter for root category

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 2 months ago #130366 by behzad
k2item counter for root category was created by behzad
Hi,
I'm using K2Tools module as Categories List (Menu) and it displays the number of items of each category in front of it, but I need to display number of items of all subcategories in front of root category, is it possible?

apartment(0)

for sale(1)
for rent (5)
others (3)

these are should be display as :

apartment(9)

for sale(1)
for rent (5)
others (3)
:(

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 2 months ago #130367 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: k2item counter for root category
I am sorry but this module only counts the items belonging directly to that category,

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 2 months ago #130368 by behzad
Replied by behzad on topic Re: k2item counter for root category
do you know any module that can do this for me (in front-end) ?

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #130369 by Lefteris
Replied by Lefteris on topic Re: k2item counter for root category
@behzad

If you are familiar with K2 templates and PHP you can use some maths to make this. However this will only count the root categories and it's direct children items. It will not be applied to the children categories of the children etc.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 2 months ago #130370 by behzad
Replied by behzad on topic Re: k2item counter for root category
hi,
thanks for your answer
could you wirte the code that you said?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum