英文:
Difference between `categories` and `mainCategories` in Shopware 6?
问题
categories
和mainCategories
在Shopware 6中有什么区别?
我在参考文档中没有找到关于这两者之间的区别的信息:
https://docs.shopware.com/en/shopware-6-en/catalogues/categories#category-overview
在API文档中也没有任何提示:
https://shopware.stoplight.io/docs/admin-api/1653192ca59cb-create-a-new-category-resources
在管理员界面中也没有明确解释它们的含义的任何内容。
英文:
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.
答案1
得分: 2
categories
是所有明确分配给产品的类别。
mainCategories
是可选的,仅与产品的SEO设置相关。假设您为单个产品分配了多个类别。您的SEO友好的URL应包括类别的面包屑,例如/clothing/men/tshirts/my-product
。由于分配了多个类别,您可以通过设置主类别来决定应该使用哪个类别作为面包屑。而且,由于您可以为每个销售渠道设置不同的SEO URL,因此每个产品可能还可以有多个主类别,但每个销售渠道最多只能有一个。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论