1

Having studied the documentation and queries in commercetools, I could not find the following thing. I know that a product has variants and multiple products can be combined into categories, but how do I combine multiple categories into something like "catalog" or "shop" ? Is there a higher level of hierarchy? For example, I have my own store in several countries and each of them has different product categories. Thanks for the answer.

I have already created an account and successfully created via HTTP API products and categories as well as product types. Now I need to combine several categories into something common.

Dmitriy
  • 11
  • 2

1 Answers1

0

The category has a parent field. So you can create a hierarchy of categories by assigning one category to another as parent. This can be done either when creating the category or via changeParent update action.

Once a category has been created it can be assigned to any product. The product can be part of multiple categories at the same time.

In case you want to have multiple different trees it makes sense to create a root category for each of the trees and reference them as starting point in your application.

Please take also a look at the category tutorial in the commercetools docs

jenschude
  • 292
  • 1
  • 6
  • Thank you @jenschude very much for the answer. A suitable solution for me was the use of such an entity as a [Stores](https://docs.commercetools.com/api/projects/stores). Store uses [Product Selections](https://docs.commercetools.com/api/projects/product-selections) and Product Selections consist products. In my case, Product Selections acts as a category in my store. – Dmitriy Jan 20 '23 at 11:10