Show number of items in category also for main category

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
michal.fehér
Posts: 44
Joined: 05 Feb 2018, 09:57

Show number of items in category also for main category

Post by michal.fehér » 29 Jul 2018, 17:19

Hi. Is there an easy way how to show number of products for main categories, not only subcategories? Maybe in config or something. I couldnt find it in docs. Thanks.
Attachments
Snip20180729_21.png
Snip20180729_21.png (94.33 KiB) Viewed 1857 times

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Show number of items in category also for main category

Post by aimeos » 30 Jul 2018, 12:30

Try this setting: https://aimeos.org/docs/Configuration/C ... sts/levels

This will show all products from sub-categories in the parent category. If you've assigned a product to two or more sub-categories, the will be shown multiple times in the main category.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

michal.fehér
Posts: 44
Joined: 05 Feb 2018, 09:57

Re: Show number of items in category also for main category

Post by michal.fehér » 30 Jul 2018, 13:16

I tried that - it has no effect on showing products, neither for showing product count in main category name.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Show number of items in category also for main category

Post by aimeos » 02 Aug 2018, 15:26

The product from the sub-categories are shown in the list view of the parent category (clear the cache if nothing has changed), but that's not reflected in the product counts. There is some JS code missing that adds the counts to the parent counts in the template:
https://github.com/aimeos/ai-client-htm ... andard.php

Are you able to create a PR for this? We would merge it into the HTML client afterwards.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply