How to group favorite items by category?
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to group favorite items by category?
Hi,
our customers have many favorites, 400 items and more.
To make the list a little clearer, we'd like to group favorites in categories (as in the default catalog).
category A
- item 1
- item 2
category B
- item x
...
Do you have a recommendation on how this can be done?
I expect to adapt the query to group by category but I couldn't get it to work:
https://github.com/aimeos/ai-client-htm ... #L220-L224
Or should all be done in the template?
https://github.com/aimeos/ai-client-htm ... e/body.php
Thank you
our customers have many favorites, 400 items and more.
To make the list a little clearer, we'd like to group favorites in categories (as in the default catalog).
category A
- item 1
- item 2
category B
- item x
...
Do you have a recommendation on how this can be done?
I expect to adapt the query to group by category but I couldn't get it to work:
https://github.com/aimeos/ai-client-htm ... #L220-L224
Or should all be done in the template?
https://github.com/aimeos/ai-client-htm ... e/body.php
Thank you
Re: How to group favorite items by category?
You can not get the products already grouped by the categories from search() method of the manager for several reasons. Best is to do group the products in the template using the groupBy() method from the Map package with a Closure that cares about retrieving the information for grouping:
https://php-map.org/#groupby
https://php-map.org/#groupby
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