{"id":230,"date":"2011-06-08T07:08:46","date_gmt":"2011-06-08T12:08:46","guid":{"rendered":"http:\/\/www.g31zone.com\/?p=230"},"modified":"2011-06-08T07:08:46","modified_gmt":"2011-06-08T12:08:46","slug":"magento-get-child-products-for-a-configurable-product","status":"publish","type":"post","link":"https:\/\/www.g31zone.com\/?p=230","title":{"rendered":"Magento get child products for a configurable product"},"content":{"rendered":"<p>Magento get products childs for a configurable product<\/p>\n<p><code><br \/>\n\/\/ $currentProduct = $this->getProduct();<br \/>\n$configurable_products = Mage::getModel('catalog\/product_type_configurable')->setProduct($currentProduct);<br \/>\n$products_collection = $configurable_products->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();<br \/>\nforeach($products_collection as $_product){<br \/>\n   echo $_product->getId() . \": \" . $_product->getName();<br \/>\n}<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento get products childs for a configurable product \/\/ $currentProduct = $this->getProduct(); $configurable_products = Mage::getModel(&#8216;catalog\/product_type_configurable&#8217;)->setProduct($currentProduct); $products_collection = $configurable_products->getUsedProductCollection()->addAttributeToSelect(&#8216;*&#8217;)->addFilterByRequiredOptions(); foreach($products_collection as $_product){ echo $_product->getId() . &#8220;:&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[170],"tags":[78,5],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-magento","tag-configurable-product","tag-magento"],"_links":{"self":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=230"}],"version-history":[{"count":3,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions\/233"}],"wp:attachment":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}