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.update (SOAP V1)
  • catalogCategoryUpdate (SOAP V2)

Update the required category. Note that you should specify only those parameters which you want to be updated.

Aliases:

  • category.update

Arguments:

TypeNameDescription
stringsessionIdSession ID
intcategoryIdID of the category to be updated
arraycategoryDataAn array of catalogCategoryEntityCreate
stringstoreViewStore view ID or code (optional)

Returns:

TypeDescription
booleanTrue if the category is updated

The catalogCategoryEntityCreate content is as follows:

TypeNameDescription
stringnameName of the category to be updated
intis_activeDefines whether the category is visible in the frontend
intpositionPosition of the category to be updated
arrayOfStringavailable_sort_byAll available options by which products in the category can be sorted
stringcustom_designThe custom design for the category
intcustom_apply_to_productsApply the custom design to all products assigned to the category
stringcustom_design_fromDate starting from which the custom design will be applied to the category
stringcustom_design_toDate till which the custom design will be applied to the category
stringcustom_layout_updateCustom layout update
stringdefault_sort_byThe default option by which products in the category are sorted
stringdescriptionCategory description
stringdisplay_modeContent that will be displayed on the category view page
intis_anchorDefines whether the category will be anchored
intlanding_pageLanding page
stringmeta_descriptionCategory meta description
stringmeta_keywordsCategory meta keywords
stringmeta_titleCategory meta title
stringpage_layoutType of page layout that the category should use
stringurl_keyA relative URL path which can be entered in place of the standard target path
intinclude_in_menuDefines whether the category is visible on the top menu bar in the frontend
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

Faults:
No Faults

Examples

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

// If some stuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$result = $client->call($session, 'catalog_category.update', array(23, array(
    'name' => 'Category name',
    'is_active' => 1,
    'position' => 1,
    //<!-- position parameter is deprecated, category anyway will be positioned in the end of list
    //and you can not set position directly, use catalog_category.move instead -->
    'available_sort_by' => 'position',
    'custom_design' => null,
    'custom_apply_to_products' => null,
    'custom_design_from' => null,
    'custom_design_to' => null,
    'custom_layout_update' => null,
    'default_sort_by' => 'position',
    'description' => 'Category description',
    'display_mode' => null,
    'is_anchor' => 0,
    'landing_page' => null,
    'meta_description' => 'Category meta description',
    'meta_keywords' => 'Category meta keywords',
    'meta_title' => 'Category meta title',
    'page_layout' => 'two_columns_left',
    'url_key' => 'url-key',
    'include_in_menu' => 1,
)));

var_dump ($result);
Request Example SOAP V2
$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$result = $client->catalogCategoryUpdate($session, 23, array(
    'name' => 'Category name 2',
    'is_active' => 1,
    'position' => 1,
    //<!-- position parameter is deprecated, category anyway will be positioned in the end of list
    //and you can not set position directly, use catalog_category.move instead -->
    'available_sort_by' => array('position'),
    'custom_design' => null,
    'custom_apply_to_products' => null,
    'custom_design_from' => null,
    'custom_design_to' => null,
    'custom_layout_update' => null,
    'default_sort_by' => 'position',
    'description' => 'Category description',
    'display_mode' => null,
    'is_anchor' => 0,
    'landing_page' => null,
    'meta_description' => 'Category meta description',
    'meta_keywords' => 'Category meta keywords',
    'meta_title' => 'Category meta title',
    'page_layout' => 'two_columns_left',
    'url_key' => 'url-key',
    'include_in_menu' => 1,
));

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->catalogCategoryUpdate((object)array('sessionId' => $sessionId->result, 'categoryId' => '23', 'categoryData' => ((object)array(
    'name' => 'Category Name Updated',
    'is_active' => '1',
    'position' => '1',
    'available_sort_by' => array('name'),
    'default_sort_by' => 'name',
    'description' => 'Category description',
    'is_anchor' => '1',
    'include_in_menu' => '1'
))));
var_dump($result->result);