Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Product attributes API

Last modified by seudo? on Thu, October 30, 2008 13:14
Source|Old Revisions  

Allows to get list of product attributes

Module: Mage_Catalog

Resource: catalog_product_attribute

Aliases:

  • product_attribute

Methods

catalog_product_attribute.currentStore

Set/Get current store view

Return: int

Arguments:

  • mixed storeView - store view id or code (optional)

Aliases:

  • product_attribute.currentStore

catalog_product_attribute.list

Retrieve attribute list

Return: array

Arguments:

  • int setId - attribute set ID

Aliases:

  • product_attribute.list

catalog_product_attribute.options

Retrieve attribute options

Return: array

Arguments:

  • mixed attributeId - attribute ID or code
  • mixed storeView - store view ID or code (optional)

Aliases:

  • product_attribute.options

Faults

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

Examples

Example 1. Getting product attribute's sets list and get attributes

  1. $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
  2. $sessionId = $proxy->login('apiUser', 'apiKey');
  3. $attributeSets = $proxy->call($sessionId, 'product_attribute_set.list');
  4.  
  5. var_dump($attributeSets);
  6.  
  7. $set = current($attributeSets);
  8.  
  9. $attributes = $proxy->call($sessionId, 'product_attribute.list', $set['set_id']);
  10.  
  11. var_dump($attributes);
  12.  
  13. $attribute_options = $proxy->call($sessionId, 'product_attribute.options', array('attribute_id'=>'put_attribute_id_as_int_here');
  14. var_dump($attribute_options);



 

Popular Wiki Tags  |  View all

 module   routes   list   data accessing   resource   backend   api   action   mysql4   controller   getModel   php   model   eav   reference 

Professional Services from the Magento Team

Professional Installation from the Magento Team

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
50188 users|558 users currently online|102355 forum posts