title: How can I get just the parent item and not the children in an invoice
body: <p>I'm trying to make our packing slips and invoices more useful, especially when we have bundled products.</p>
  
  <p>How can I show just the parent item and not the children in an invoice?</p>
  
  <p>When I use <code>$order-&gt;getAllItems()</code> I get two lines in output:</p>
  
  <pre><code>parent-child sku
  
  child sku
  </code></pre>
  
  <p>If I use <code>$order-&gt;getAllVisibleItems()</code> I only get the parent, which is what I want. </p>
  
  <pre><code>Parent sku
  </code></pre>
  
  <p>Now  <code>invoice-&gt;getAllItems</code> with  produces the two lines  Parent-Child and Child
  But <code>invoice-&gt;getAllVisibleItems</code> with  produces no lines</p>
  
  <p>So it will show qty and amt on the invoice twice. not good for customers or packers.</p>
  
  <pre><code>&lt;?php
  require_once '../mage1/app/Mage.php';
  require_once('Zend/Pdf.php');  
  $app = Mage::app();
  Mage::register('isSecureArea', true); 
  
  $orderId = '500000555' ;  
  
  $order = Mage::getModel('sales/order')-&gt;loadByIncrementId($orderId);
  
  foreach ($order-&gt;getAllVisibleItems() as $item){
      echo 'ITEM: ' . $item-&gt;getSku() . '&lt;br /&gt;';
  }
  //vs invoice
  echo 'Invoice Section &lt;br /&gt;' ;
  
  if ($order-&gt;hasInvoices()) {
      echo 'Order has invoices'  . '&lt;br /&gt;';
  foreach ($order-&gt;getInvoiceCollection() as $_eachInvoice) {
  
      foreach ($_eachInvoice-&gt;getAllVisibleItems as $invitem){
      //foreach ($_eachInvoice-&gt;getAllItems() as $invitem){
          //echo 'Object &lt;br /&gt;';
          var_dump(get_object_vars($invitem));
          //print_r($invitem);  echo '&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;';
          echo 'INVOICE ITEM: ' . $invitem-&gt;getSku() . '&lt;br /&gt;';
          }
      }
  } else { echo 'no invoices' ; };
  ?&gt;
  </code></pre>