Set price to the simple product related to a configurable product Magento

372 views Asked by At

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

enter image description here

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:

http://www.bubblecode.net/en/2012/04/20/magento-api-associate-simple-products-to-configurable-or-grouped-product/

1

There are 1 answers

0
Suman Singh On

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/