Category attributes API

Last modified by Michael on Fri, July 4, 2008 12:23
Source|Old Revisions  

This is an old revision of the document!


Allows to get attributes and options for category.

Module: Mage_Catalog

Resource: catalog_category_attribute

Aliases:

  • category_attribute

Methods

catalog_category_attribute.currentStore

Set/Get current store view

Return: int

Arguments:

  • mixed storeView - Store view ID or code. (optional)

Aliases:

  • category_attribute.currentStore

catalog_category_attribute.list

Retrieve category attributes

Return: array

Aliases:

  • category_attribute.list

catalog_category_attribute.options

Retrieve attribute options

Arguments:

  • attributeId - attribute id or code
  • storeView - store view id or code

Aliases:

  • category_attribute.options

Faults

Fault Code Fault Message
100 Requested store view not found.
101 Requested attribute not found.

Examples

Example 1. Retrieving attributes and options

  1. $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
  2. $sessionId = $proxy->login('apiUser', 'apiKey');
  3. $attributes = $proxy->call($sessionId, 'category_attribute.list');
  4. foreach ($attributes as &$attribute) {
  5.    if (isset($attribute['type'])
  6.        && ($attribute['type'] == 'select' || $attribute['type'] == 'multiselect')) {
  7.        $attribute['options'] = $proxy->call($sessionId, 'category_attribute.options', $attribute['code']);
  8.    }
  9. }
  10. var_dump($attributes);



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs