How To Get Simple Products From Configurable Products?

Magento get simple product from configurable :-
To begin with configurable products are collection of simple products only. It is necessary to have simple products to make a configurable products. You can get all child products of a configurable products using the configurable product’s id with below syntax and getting the desired result from there.


/* First We Have To Load product by product_id */
$product = Mage::getModel('catalog/product')->load($product_id);

/* Then Get All child products id */
$childIds = Mage::getModel('catalog/product_type_configurable')
->getChildrenIds($product->getId());

/* Get children products all associated children products data */
$childProducts = Mage::getModel('catalog/product_type_configurable')
->getUsedProducts(null,$product);

You can Write the product id of the configurable product and then get all child items data for further product details. In result you will find product details SKU, image, id, name, price and short descriptions.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *