Category¶
The Category object represents a single product category in the storefront.
classDiagram
direction LR
Category --> Category
Category --> CategoryUrl
Category --> ProductsList
ProductsList "1" --o "*" Product
Category --> CategoriesList
CategoriesList "1" --o "*" Category
class Product{
}
class ProductsList{
}
class CategoriesList{
}
class CategoryUrl{
}
class Category{
int id
string name
CategoryUrl url
string description
string additionalDescription
bool isRoot
bool isParent
Category parentCategory
CategoriesList subCategories
ProductsList products
ProductsList productsInSubTree
Metafields metafields
}
Properties¶
| Attribute name | Type | Description |
|---|---|---|
| id | int |
The unique identifier of the category. |
| name | string |
The name of the category. |
| url | CategoryUrl |
The CategoryUrl object that represents the url to the category. |
| description | string |
The description of the category. |
| additionalDescription | string |
The additional description of the category. |
| isRoot | bool |
Return true if category has no parent. |
| isParent | bool |
Return true if category has subcategories. |
| parentCategory | Category |
Reference to the Category object that represents parent category. |
| subcategories | CategoriesList |
Reference to the CategoriesList object that represents the list of child Category object associated with this category. |
| products | ProductsList |
Reference to the ProductsList object that represents the list of Product objects associated directly with this category. |
| productsInSubTree | ProductsList |
Reference to the ProductsList object that represents the list of Product objects associated with this category and all its subcategories. |
| metafields | Metafields |
Reference to the Metafields object that provides access to the namespaced containers for key - value pairs of data. |