What are the differences between categories
and mainCategories
in Shopware 6?
I don't find anything in the references about that difference:
https://docs.shopware.com/en/shopware-6-en/catalogues/categories#category-overview
Nor any hint in the API docs
https://shopware.stoplight.io/docs/admin-api/1653192ca59cb-create-a-new-category-resources
Nor anything in the admin GUI that makes their meaning clear.
categories
are all categories explicitly assigned to the product.
mainCategories
are optional and only relevant for the SEO settings of a product. Let's say you have multiple categories assigned to a single product. Your SEO-friendly URL should include the breadcrumb of the category for example /clothing/men/tshirts/my-product
. Since there are multiple categories assigned, you can decide which category should be used for the breadcrumb by setting the main category. And since you could have a different SEO-URL for each sales channel, there could also be multiple main categories per product, but at most one per sales channel.