title: How to get Magento Order data from Observer
body: <p>Ok, Ive searched all over the web and nothing worked. The results were very inconsistent. Let me first show you what I have here. It will create an export file in the end but unable to obtain order data and object.</p>
  
  <pre><code>class Packagename_Modulename_Model_Observer
  {
      public function exportFeed (Varien_Event_Observer $observer)
      {
          $order = $observer-&gt;getEvent()-&gt;getOrder();
  
          $ordered_items = $order-&gt;getAllItems();   
  </code></pre>
  
  <p>and in config.xml</p>
  
  <pre><code>&lt;global&gt;
    &lt;events&gt;
          &lt;sales_order_place_after&gt;
              &lt;observers&gt;
                  &lt;packagename_modulename_order_observer&gt;
                      &lt;class&gt;Packagename_Modulename_Model_Observer&lt;/class&gt;
                      &lt;method&gt;exportFeed&lt;/method&gt;
                  &lt;/packagename_modulename_order_observer&gt;
              &lt;/observers&gt;
          &lt;/sales_order_place_after&gt;
      &lt;/events&gt;
  &lt;/global&gt;
  </code></pre>
  
  <p>Now, Ive seen people use without Varien_Event_Observer like that,</p>
  
  <pre><code>public function exportFeed ($observer)
  </code></pre>
  
  <p>Ive also tried without getEvent()</p>
  
  <pre><code>$order = $observer-&gt;getOrder();
  </code></pre>
  
  <p>and something different in config.xml, with and without singleton</p>
  
  <pre><code>&lt;type&gt;singleton&lt;/type&gt;
  &lt;class&gt;packagename_modulename/observer&lt;/class&gt;
  </code></pre>
  
  <p>All I want to do is export an inventory feed of that particular item ordered when an order is placed via Magento.</p>