title: Unable to fetch all items of an order in Magento?
body: <p>I am developing a <code>module</code> in <code>magento</code> in which I am showing all orders on a page and along with every order, I am showing the full order information including the products purchased in respect to that order. I am able to show all order but I don't understand that the orders which are having multiple products in it is just showing single product and when I check this in Order Under Sales which is Sales->Order then more than 1 product is showing there.</p>
  
  <p><strong>Here's my code:</strong></p>
  
  <pre><code>public function indexAction()
  {
      $model = Mage::getModel('sales/order');
      $product_model = Mage::getModel('catalog/product');
  
      $collection = $model-&gt;getCollection()
      -&gt;addFieldToFilter('status', array("in" =&gt; array('complete','closed','pending','holded','payment_review','pending_payment','pending_paypal','processing')));
  
      $data = array();
      $orderArr = array();
  
      $records = 0;
      foreach($collection as $order)
      {
          $data[$records]['order_data']['shipping_address'] = $order-&gt;getShippingAddress()-&gt;getData(); // get shipping details
          $data[$records]['order_data']['billing_address'] = $order-&gt;getBillingAddress()-&gt;getData(); // get billing details
  
          $data[$records]['order_data']['order_total'] = $order-&gt;getGrandTotal(); // get total amount
          $items_obj = $model-&gt;loadByIncrementId($order['increment_id']); // get all items
          $items = $items_obj-&gt;getAllItems();
  
          $data[$records]['order_data']['order_id'] = $order['increment_id']; 
  
          $i = 0;
          $productData = array();
          $orderProductArr = array();
          foreach($items as $itemId =&gt; $item)
          {  
              $_product = $product_model-&gt;load($item-&gt;getProductId()); // getting product details here to get description
  
              $taxClassId = $_product-&gt;getData("tax_class_id");
              $taxClass = $_product-&gt;getData("tax_class_name");
  
              $taxRate = $order['tax_amount'];
  
              $orderProductArr[$i]['web_id'] = $item-&gt;getProductId();
              $orderProductArr[$i]['quantity'] = $item-&gt;getQtyToInvoice();
              $orderProductArr[$i]['price'] = $item-&gt;getPrice();
              $orderProductArr[$i]['description'] = $_product-&gt;getDescription();
              $orderProductArr[$i]['currency'] = $order['order_currency_code'];
              $orderProductArr[$i]['tax_id'] = $taxClassId;
              $orderProductArr[$i]['tax_amt'] = $taxRate;
              $orderProductArr[$i]['total_amt'] = ($item-&gt;getPrice()*$item-&gt;getQtyToInvoice())+($taxRate);
  
              $productData[$i]['title'] = $item-&gt;getName();
              $productData[$i]['web_product_id'] = $item-&gt;getProductId();
              $productData[$i]['price'] = $item-&gt;getPrice();
              $productData[$i]['product_sku'] = $item-&gt;getSku();
              $productData[$i]['tax_class'] = $taxClassId;
              $productData[$i]['description'] = $_product-&gt;getDescription();
  
              $tax_arr[$i]['tax_id'] = $taxClassId;
              $tax_arr[$i]['tax_class'] = $taxClassId;
              $tax_arr[$i]['tax_amt'] = $taxRate;
  
              $i++;
          }
  
          $data[$records]['order_data']['product_details'] = $orderProductArr;
          $data[$records]['order_data']['order_product_details'] = $productData;
          $data[$records]['order_data']['tax_arr'] = $tax_arr;
          $data[$records]['order_data']['shipping_amount'] = $order-&gt;getShippingAmount();
          $data[$records]['order_data']['order_details'] = $order-&gt;toArray();
          unset($orderProductArr);
          unset($productData);
          $records++;
      }
  
       echo "&lt;pre&gt;";
       print_r($data);
       echo "&lt;/pre&gt;";
  
  }
  </code></pre>
  
  <p>Can anyone please help me with this?</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks.</p>