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.
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);
$cProduct->getTypeInstance()->setUsedProductAttributeIds($superAttributeIds);
$cProduct->setCanSaveConfigurableAttributes(true);
try
{
$cProduct->save();
}
catch( Exception $e)
{
echo $e->getMessage();
}