0

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!.

1 Answer 1

2
<?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());
             }
      }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.