shop.category.getParents
Returns the full list of parent categories of the specified subcategory.
Parameters
-
id
GET
ID of the subcategory whose parent categories should be returned.
-
reverse
GET
Optional
Whether the returned list of parent categories must be sorted in the descending order (true). By default (false) parent categories are sorted in the ascending order.
-
format
GET
Optional
Sets response format. Available options:
json
(default),xml
.
Return value
Array with a list of all parent categories for the specified category. Each parent category's sub-array contains the following data:
- []['id'] int Category ID.
- []['depth'] int Category nesting depth starting with 0.
- []['parent_id'] int ID of category’s parent category or 0 if there is no parent category.
- []['name'] string Category name.
- []['meta_title'] string Value of the <TITLE> tag.
- []['meta_keywords'] string Value of the keywords meta tag.
- []['meta_description'] string Value of the description meta tag.
- []['type'] int Category type: 0 (static), 1 (dynamic).
- []['url'] string Category’s editable URL part used in the storefront.
- []['full_url'] string Category’s relative URL including the URLs of its parent categories.
- []['count'] int Number of products for which the current category is selected as the main category. Not used for dynamic categories.
- []['description'] string Category description.
- []['conditions'] string Description of product selection rules for dynamic categories. Not used for static categories.
- []['create_datetime'] datetime Category’s creation date and time.
- []['edit_datetime'] datetime Category’s last editing date and time.
- []['filter'] string Information about product filter setup, in the form of filter field identifiers separated by commas. As identifiers can be used numeric IDs of product features, and the 'price' string for the filter by price. The sort order of the field identifiers corresponds to the sort order of filter fields.
- []['sort_products'] string Default product sorting rule.
- []['include_sub_categories'] int Flag denoting whether products included in the category’s sub-categories must also be displayed in the current category: 0 (no), 1 (yes).
- []['status'] int Category visibility status: 0 (hidden), 1 (visible).