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.

Product Attribute Sets

Allows you to retrieve product attribute sets.

Resource Name: catalog_product_attribute_set

Aliases:

  • product_attribute_set

Methods:

Faults:
Fault CodeFault Message
100Attribute set with requested id does not exist.
101Invalid data given.
102Error while creating attribute set. Details in error message.
103Error while removing attribute set. Details in error message.
104Attribute set with requested id does not exist.
105Unable to remove attribute set as it has related goods. Use forceProductsRemove parameter to remove attribute set with all goods.
106Attribute with requested id does not exist.
107Error while adding attribute to attribute set. Details in error message.
108Attribute group with requested id does not exist.
109Requested attribute is already in requested attribute set.
110Error while removing attribute from attribute set. Details in error message.
111Requested attribute is not in requested attribute set.
112Requested group exist already in requested attribute set.
113Error while adding group to attribute set. Details in error message.
114Error while renaming group. Details in error message.
115Error while removing group from attribute set. Details in error message.
116Group can not be removed as it contains system attributes.
117Group can not be removed as it contains attributes, used in configurable products.
Example:
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

echo "<pre>";
// create new set
$setName = "New Test Set";
$skeletonId = 4;

$setId = $proxy->call(
    $sessionId,
    "product_attribute_set.create",
    array(
         $setName,
         $skeletonId
    )
);

// Get list
$setList = $proxy->call(
    $sessionId,
    "product_attribute_set.list"
);
echo "Set list:\n";
print_r($setList);

// create group
$groupName = "Test Group";
$groupId = $proxy->call(
    $sessionId,
    "product_attribute_set.groupAdd",
    array(
         $setId,
         $groupName
    )
);

// rename group
$newGroupName = "New Test Group";
$result = $proxy->call(
    $sessionId,
    "product_attribute_set.groupRename",
    array(
         $groupId,
         $newGroupName
    )
);

// add attribute
$attributeId = 83;
$result = $proxy->call(
    $sessionId,
    "product_attribute_set.attributeAdd",
    array(
         $attributeId,
         $setId
    )
);

//remove attribute
$result = $proxy->call(
    $sessionId,
    "product_attribute_set.attributeRemove",
    array(
         $attributeId,
         $setId
    )
);

// remove group
$result = $proxy->call(
    $sessionId,
    "product_attribute_set.groupRemove",
    array(
         $groupId
    )
);

// remove set
$result = $proxy->call(
    $sessionId,
    "product_attribute_set.remove",
    array(
         $setId
    )
);

Create the Magento file system owner


Table of contents