5

I want to remove all associated product from configurable product .

How can i do this

I m trying to do like this

$product = Mage::getModel('catalog/product')->load(11);
$product->getTypeInstance()->setUsedProductAttributeIds();
$product->save();

but its not working

6

use the below code:

Mage::getResourceSingleton('catalog/product_type_configurable')
    ->saveProducts($product, array());

Send saveProducts() second params as empty arrya

Your code like this:

$product = Mage::getModel('catalog/product')->load(11);
Mage::getResourceModel('catalog/product_type_configurable')
    ->saveProducts($product, array());
| improve this answer | |
  • How can this be achieved in Magento 2? – Nausif Aug 1 '17 at 10:01
  • @Nausif did you find this solution in Magento 2? If yes, can you guide... – Ghulam Akbar Jul 8 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.