Hide empty categories
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 22
- Joined: 26 Oct 2019, 12:38
Hide empty categories
Is there a configuration option for the catalog filter tree to hide empty categories? Or would this require changes to templates?
Testing CSV import of an entire category tree and at the moment am not working on assigning products. I notice that aimeos will display all categories even if no stock is assigned.
I suppose the wrinkle here is if there is a parent child relationship you can only hide a parent where none of the children have assigned products either?
Or is the built-in solution to use the category.status to disable categories not used yet? The only issue is that needs to be manually tracked?
Testing CSV import of an entire category tree and at the moment am not working on assigning products. I notice that aimeos will display all categories even if no stock is assigned.
I suppose the wrinkle here is if there is a parent child relationship you can only hide a parent where none of the children have assigned products either?
Or is the built-in solution to use the category.status to disable categories not used yet? The only issue is that needs to be manually tracked?
Re: Hide empty categories
There are three things you mix:pixelplumber wrote: ↑13 Jan 2020, 02:53 Is there a configuration option for the catalog filter tree to hide empty categories? Or would this require changes to templates?
- categories
- products
- stocks
All three are independent at first but there's a relation between categories and products resp. products and stocks. The catalog filter displaying the categries doesn't know by default if there are products attached or if these products are in stock.
Exactly, this is the second problem you will face when you try to hide empty categories automatically.pixelplumber wrote: ↑13 Jan 2020, 02:53 Testing CSV import of an entire category tree and at the moment am not working on assigning products. I notice that aimeos will display all categories even if no stock is assigned.
I suppose the wrinkle here is if there is a parent child relationship you can only hide a parent where none of the children have assigned products either?
This is the easiest option. Another option is the catalog count component which is called by the catalog filter via JS and which returns the number of products that are matched (or assigned without a filter) to the categories. You can use it to hide the categories via CSS if their count is 0 as it is already done for the attribute filter.pixelplumber wrote: ↑13 Jan 2020, 02:53 Or is the built-in solution to use the category.status to disable categories not used yet? The only issue is that needs to be manually tracked?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star