shop.category.getTree

Returns a tree of product categories.

Parameters

  • parent_id GET

    ID of the category which should be considered as the tree root.

  • depth GET Optional

    Number of tree levels which should be returned. If not specified, the entire category tree is returned.

  • format GET Optional

    Sets response format. Available options: json (default), xml.

Return value

Category tree array. Each 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).

Example

https://demo1.webasyst.com/api.php/shop.category.getTree?