Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How get Configurable product’s Children’s (simple product) custom attributes? 
 
wrgill999
Jr. Member
 
Total Posts:  10
Joined:  2009-05-11
 

i have a custom attribute of set_count and my_id for certain products.

set_count is used for configurable products, so a customer can pick 2 or 4 wine glasses, for example.
each of the configurable product’s children has a unique my_id.

how can i grab and display the unique my_id for the simple product when its parent configurable product’s set_count
is changed in the drop down on the frontend by a customer?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mirelon
Member
 
Total Posts:  41
Joined:  2008-11-04
 

I had similar issue, struggled through it and this code worked for me:
(input is $_product and result is iterating child products)

$conf Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$col $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
foreach(
$col as $simple_product){
  var_dump
($simple_product->getId());
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Darren Dub
Member
 
Total Posts:  35
Joined:  2010-03-11
 

Thank you so much for sharing.  I was having such a hard time figuring this out.  Nothing else worked.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sunil rajput
Jr. Member
 
Total Posts:  17
Joined:  2009-04-04
 

[Here is the good link may help to on How to get associated child product

http://www.phptechi.com/how-to-get-associated-child-product.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top