Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Module: Mage_Catalog

The Mage_Catalog module allows you to manage categories and products.

Resource Name: catalog_category

Aliases:

  • category
Method:
  • catalog_category.info (SOAP V1)
  • catalogCategoryInfo (SOAP V2)

Allows you to retrieve information about the required category.

Aliases:

  • category.info

Arguments:

TypeNameDescription
stringsessionIdSession ID
intcategoryIdCategory ID
stringstoreViewStore view ID or code (optional)
ArrayOfStringattributesArray of attributes (optional)

Returns:

TypeNameDescription
arrayinfoArray of catalogCategoryInfo

The catalogCategoryInfo content is as follows:

TypeNameDescription
stringcategory_idCategory ID
intis_activeDefines whether the category is active
stringpositionCategory position
stringlevelCategory level
stringparent_idParent category ID
stringall_childrenAll child categories of the current category
stringchildrenNames of direct child categories
stringcreated_atDate when the category was created
stringupdated_atDate when the category was updated
stringnameCategory name
stringurl_keyA relative URL path which can be entered in place of the standard target path (optional)
stringdescriptionCategory description
stringmeta_titleCategory meta title
stringmeta_keywordsCategory meta keywords
stringmeta_descriptionCategory meta description
stringpathPath
stringurl_pathURL path
intchildren_countNumber of child categories
stringdisplay_modeContent that will be displayed on the category view page (optional)
intis_anchorDefines whether the category is anchored
ArrayOfStringavailable_sort_byAll available options by which products in the category can be sorted
stringcustom_designThe custom design for the category (optional)
stringcustom_apply_to_productsApply the custom design to all products assigned to the category (optional)
stringcustom_design_fromDate starting from which the custom design will be applied to the category (optional)
stringcustom_design_toDate till which the custom design will be applied to the category (optional)
stringpage_layoutType of page layout that the category should use (optional)
stringcustom_layout_updateCustom layout update (optional)
stringdefault_sort_byThe default option by which products in the category are sorted
intlanding_pageLanding page (optional)
intinclude_in_menuDefines whether the category is available on the Magento top menu bar
stringfilter_price_rangePrice range of each price level displayed in the layered navigation block
intcustom_use_parent_settingsDefines whether the category will inherit custom design settings of the category to which it is assigned. 1 - Yes, 0 - No

Examples

Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'catalog_category.info', '5');
var_dump($result);

// If you don't need the session anymore
//$client->endSession($session);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->catalogCategoryInfo($sessionId, '5');
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey'));

$result = $proxy->catalogCategoryInfo((object)array('sessionId' => $sessionId->result, 'categoryId' => '5'));
var_dump($result->result);
Response Example SOAP V1
array
  'category_id' => string '5' (length=1)
  'is_active' => string '1' (length=1)
  'position' => string '1' (length=1)
  'level' => string '2' (length=1)
  'parent_id' => int 3
  'increment_id' => null
  'created_at' => string '2012-03-29 12:30:51' (length=19)
  'updated_at' => string '2012-03-29 14:25:08' (length=19)
  'name' => string 'Mobile Phones' (length=13)
  'url_key' => string 'mobile-phones' (length=13)
  'thumbnail' => null
  'description' => string 'Category for cell phones' (length=24)
  'image' => null
  'meta_title' => string 'Cell Phones' (length=11)
  'meta_keywords' => string 'cell, phone' (length=11)
  'meta_description' => null
  'include_in_menu' => string '1' (length=1)
  'path' => string '1/3/4' (length=5)
  'all_children' => string '4' (length=1)
  'path_in_store' => null
  'children' => string '' (length=0)
  'url_path' => string 'mobile-phones.html' (length=18)
  'children_count' => string '0' (length=1)
  'display_mode' => string 'PRODUCTS' (length=8)
  'landing_page' => null
  'is_anchor' => string '1' (length=1)
  'available_sort_by' => null
  'default_sort_by' => null
  'filter_price_range' => null
  'custom_use_parent_settings' => string '1' (length=1)
  'custom_apply_to_products' => null
  'custom_design' => null
  'custom_design_from' => null
  'custom_design_to' => null
  'page_layout' => null
  'custom_layout_update' => null