Product 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!
randomdennis
Posts: 38
Joined: 10 Oct 2024, 12:51

Product Main Category

Post by randomdennis » 01 Apr 2025, 10:37

Hello everyone,

Is there already a way to define a main category for a product when it belongs to multiple categories? Right now, on the product detail page, the first category (alphabetically) is displayed by default.

It would be useful to have an option to set a primary category for each product. If this feature doesn’t exist yet, I might need to implement it myself.

Has anyone already tackled this, or is there a recommended approach?

Thanks!

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

Re: Product Main Category

Post by aimeos » 04 Apr 2025, 16:05

You could add a key/value pair to the list item connecting the product and the catalog with "main: 1" for example. Then, in the templates, you have to filter for that value to display/use only the that category.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

randomdennis
Posts: 38
Joined: 10 Oct 2024, 12:51

Re: Product Main Category

Post by randomdennis » 07 May 2025, 13:48

I came to the solution by adding a house icon to categories and if you click on it it writes an entry in the product config with cat = catcode which i use in frontend.

Post Reply