title: Magento - getting data from an order or invoice
body: <p>I'm trying to write a Magento (CE 1.4) extension to export order data once an order has been paid for. I’ve set up an observer that hooks in to the sales_order_invoice_save_after event, and that is working properly - my function gets executed when an invoice is generated. But I’m having trouble getting information about the order, such as the shipping address, billing address, items ordered, order total, etc.</p>
  
  <p>This is my attempt:</p>
  
  <pre><code>class Lightbulb_Blastramp_Model_Observer {
      public function sendOrderToBlastramp(Varien_Event_Observer $observer) {
          $invoice = $observer-&gt;getEvent()-&gt;getInvoice();
          $order = $invoice-&gt;getOrder();
  
          $shipping_address = $order-&gt;getShippingAddress();
          $billing_address = $order-&gt;getBillingAddress();
          $items = $invoice-&gt;getAllItems();
          $total = $invoice-&gt;getGrandTotal();
  
          return $this;
      }
  }
  </code></pre>
  
  <p>I tried doing a print_r on all those variables, and ended up getting a lot of data back. Could someone point me in the right direction of getting the shipping address of an order?</p>
  
  <p>Thanks!</p>