im create configurable product programatically. all works fine but attribute is not set to configurable product when i open product in admin is look like

see image.

enter image description here

how i can set attribute to configurable product..

i used this code to set attribute

$superAttributeIds = array('92');
$cProduct = Mage::getModel('catalog/product')->load(1261);

catch( Exception $e) 
        echo $e->getMessage();

1 Answer 1


Try this solution

        foreach (array('size', 'color') as $attributeCode) {
            $usedProductAttributesIds[] = Mage::getModel('eav/entity_attribute')->loadByCode(Mage_Catalog_Model_Product::ENTITY, $attributeCode)->getId();

        $configurableAttributesData = $configProduct->getTypeInstance()->getConfigurableAttributesAsArray();


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.