Magento - Get children/options of an ORDERED bundle item

magento

Solution

Here is how you could find out what products are supposed to be attached to the bundle products in the list with all of the other items:

foreach ($order->getAllItems() as $item) {
     //if a product has parents (simple product of configurable/bundled/grouped product) load his Parent product type
     if ( $item->getParentItemId()) {
         $parent_product_type = Mage::getModel('sales/order_item')->load($item->getParentItemId())->getProductType();
          //if Parent product type is Bundle
          if ($parent_product_type == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
              // your code goes here (do whatever you need to do)
          }
      }
}

Problem

I'm having difficulty getting all of the child products and their options of an ordered bundle item. Is this possible?

Original source

Related problems