Home » Magento20 July 2010

Magento: How to get all associated children product of a configurable product?

A configurable product can have multiple other products associated to it. This article shows how to fetch all the children products that are associated with a configurable product.

Here is the code:

Hope this helps. Thanks.

Magento

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Alok

    Hi Mukesh,

    for a configurable product, not all the child product id are coming.
    please help me for this situation.

    Thanks,
    Alok

  • riti

    Hi,

    How can I sort all child products based on attribute.

    $childCollection = Mage::getModel(‘catalog/product_type_configurable’)->addAttributeToSort(‘weight’, ‘asc’);

    $childProducts = $childCollection->getUsedProducts(null,$_product);

    OR

    $childCollection = Mage::getModel(‘catalog/product_type_configurable’);
    $childProducts = $childCollection->getUsedProducts(null,$_product);
    $childProducts = $childCollection->addAttributeToSort(‘weight’, ‘asc’);

    I have tried both the solutions but nothing works.
    Can you help!

    Thanks,
    Riti

  • Hi, I’ve tried all 3 functions and noticed that if the id’s of the simple products have a range from for example 2000 t0 2400 and the configurable product associated has the id 2250 then these methods will only return the simple products from 2251 to 2400.

    Has anyone else noticed this too, is there a way to solve it ?
    thanks for your help

  • Hoang Vjet

    hi ! please help
    $product = Mage::getModel(‘catalog/product’)->load(54); // okie
    Mage::getModel(‘catalog/product_type_configurable’)->getUsedProducts(null,$product);  //error
     print_r($childProducts);  

    thank

  • How do you get the children of a configurable using the SOAP api that magento has?

  • Ravi

    Hello.. I want associate product of group products in list page… is there any method to do same ??

  • Dhara

    Hie. Can you please describe how to fetch particular data from the associative products? E.G. How to fetch the image or stock items of associative products?

  • Dhara

    Hie. Can you please describe how to fetch particular data from the associative products? E.G. How to fetch the image or stock items of associative products?

  • Dhara

    Hie. Can you please describe how to fetch particular data from the associative products? E.G. How to fetch the image or stock items of associative products?

  •  Same problem for me

  • Hell_dude

    in magento 1.6.2.0 (m.b. in latest version too) use Mage::getModel(‘catalog/product_type_grouped’)