Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Thanks to @marius. I got a answer from this linkthis link.

You can assign simple product to configurable by following code

Mage::getResourceSingleton('catalog/product_type_configurable') ->saveProducts($mainConfigrableProduct, $simpleProductIds); 

Here $mainConfigrableProduct is configurable product object and $simpleProductIds is array of simple product id

Thanks to @marius. I got a answer from this link.

You can assign simple product to configurable by following code

Mage::getResourceSingleton('catalog/product_type_configurable') ->saveProducts($mainConfigrableProduct, $simpleProductIds); 

Here $mainConfigrableProduct is configurable product object and $simpleProductIds is array of simple product id

Thanks to @marius. I got a answer from this link.

You can assign simple product to configurable by following code

Mage::getResourceSingleton('catalog/product_type_configurable') ->saveProducts($mainConfigrableProduct, $simpleProductIds); 

Here $mainConfigrableProduct is configurable product object and $simpleProductIds is array of simple product id

Source Link

Thanks to @marius. I got a answer from this link.

You can assign simple product to configurable by following code

Mage::getResourceSingleton('catalog/product_type_configurable') ->saveProducts($mainConfigrableProduct, $simpleProductIds); 

Here $mainConfigrableProduct is configurable product object and $simpleProductIds is array of simple product id