I want to import configurable products in magento through xml. I have imported simple products.To create configurable product, I followed the process given here http://www.magentocommerce.com/boards/viewthread/46844/. It works. If I remove
$data=array('5791'=>array('0'=>array('attribute_id'=>'491','label'=>'vhs','value_index'=>'5','is_percent'=>0,'pricing_value'=>'')),'5792'=>array('0'=> array('attribute_id'=>'491','label'=>'dvd','value_index'=>'6','is_percent'=>0,'pricing_value'=>'')));
$product->setConfigurableProductsData($data);
Still it works. and its good for me. But my problem is this code:
$data = array('0'=>array('id'=>NULL,'label'=>'Media Format','position'=> NULL,'values'=>array('0'=>array('value_index'=>852,'label'=>'vhs','is_percent'=>0,
'pricing_value'=>'0','attribute_id'=>'182'),'1'=>array('value_index'=>853,'label'=>'dvd',
'is_percent'=>0,'pricing_value'=>'0','attribute_id'=>'182')
),'attribute_id'=>182,'attribute_code'=>'media_format','frontend_label'=>'Media Format',
'html_id'=>'config_super_product__attribute_0'));
Can't i use just $product->getTypeInstance()->setUsedProductAttributeIds(array(491));
to set super-Attributeid =491 for configurable product ? Why the detail of attribute is required here?
Can anybody help me to find easiest way to create configurable product programmatically.