I need to get a collection of products between simple products and grouped products but the grouped products need have all those associated products active.
Any idea?.
Thank you!.
<?php
$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('type_id', array('eq' => 'grouped'));
foreach ($products as $product) {
$associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
foreach ($associatedProducts as $aspro) {
echo "<pre>";print_r($aspro->getData());
}
}
?>