I am making the link between simple and configurable products as follows:
Mage::getResourceSingleton('catalog/product_type_configurable')
->saveProducts($confProduct, $simplesToAddConfig);
But in this way it is not possible to inform the price of the product
I tried that way too, but I did not succeed:
$simpleProductsData = array(
'label' => "abc",
'attribute_id' => '128',
'value_index' => '21',
'is_percent' => '0',
'pricing_value' => '150',
);
$configurableProductsData[ 973 ][] = $simpleProductsData;
$confProduct->setCanSaveConfigurableAttributes(true);
$confProduct->setConfigurableProductsData($configurableProductsData);
Is there any way to report this field?
Thank you so much
----EDIT I got the solution by adapting this module:
You can find many article to create the simple and configurable products. I am sharing a blog post which explained each steps precisely. and also share the module code to create products.
https://blog.amasty.com/creating-magento-simple-configurable-products-programmatically/