Keyword

Categories View and K2 Tools Categories List (menu): Items Counter don't match

  • Warren Diggles
  • Warren Diggles's Avatar Topic Author
  • Offline
  • New Member
More
3 years 5 months ago #179151 by Warren Diggles
Hello,

Joomla v3.9.27
K2 v2.10.3

I've set up a K2 category in Catalog Mode. The category thumbnail listings display the Items Counter correctly, but the K2 Tools Categories List (menu) does not. It seems that the K2 Tools is not included subcategories in the Items Counter like the standard categories page does.

It seems like a bug. If not, is it possible to include Subcategory products in the K2 Tools Categories List Items Counter?

Screenshot:


Thank you for any help you can provide.

Warren
Attachments:

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

More
3 years 5 months ago #179175 by JoomlaWorks
If I recall correctly, the counters are for items directly belonging to a category, not its subcategories. So if "Yoghurt" has no direct items in it, but its sub-category (e.g. "Greek") has 5, then you'll see 5 on the right but 0 on the left (column).

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

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

  • Warren Diggles
  • Warren Diggles's Avatar Topic Author
  • Offline
  • New Member
More
3 years 5 months ago #179179 by Warren Diggles
Hey Fotis,

It sure seems to be working that way. To me it doesn't seem right that the categories display (thumbnails) on the right does count items in subcategories, but the categories list does not. It seems like they should both count the same thing.

I made overrides of the K2 Tools module files to try and customize the code so the categories list counts items in subcategories, but the override does not add a helper.php file in the html folder. The helper.php file has all the code in it.

My next step is to figure out how to make an override for the helper.php file. Then once that is done I'll see if I can customize the code to include items in subcategories in the count.

Do you have any experience in these areas?

 

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

More
3 years 5 months ago #179187 by JoomlaWorks
It's easier to just copy the entire mod_k2_tools module to mod_k2_mytools and change it how you like.

As for why the counters work like this, it's actually correct. The module list the absolute numbers per category. But the component is flexible to display items in a linear or catalog mode. So they work different. So it's normal that the counters for the catalog ARE different as well. It would make no sense to report 0 items in a catalog because there are no direct items in it, even though there are sub-categories with lots of items in them ;)

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

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

  • Warren Diggles
  • Warren Diggles's Avatar Topic Author
  • Offline
  • New Member
More
3 years 5 months ago #179188 by Warren Diggles

It would make no sense to report 0 items in a catalog because there are no direct items in it, even though there are sub-categories with lots of items in them ;)

Exactly my point. The thumbnail shows 14 yoghurt items and the menu shows 0, it doesn't make sense. I guess it would be ideal to have the option in the module to include or not include subcategories in the item count.

It's easier to just copy the entire mod_k2_tools module to mod_k2_mytools and change it how you like.

Thank you for the tip on this. I'll try it out!

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


Powered by Kunena Forum