title: Export order info to .txt file once order is placed
body: <p>I have researched and tried all possible ideas I could come up with but not having any luck with the below...what am I missing?</p>
  
  <p>The idea is to export a text file once an order has been placed on my Magento store. The text file will then be used for the printer to print the order automatically.</p>
  
  <p>I have created a custom module in Magento which looks at the "sales_order_place_after" (Please advise if this is the wrong event to look at for this) event and executes the Observer.php code.</p>
  
  <p>I have this in config.xml file:</p>
  
  <pre><code>    &lt;events&gt;
          &lt;sales_order_place_after&gt;
              &lt;observers&gt;
                  &lt;company_printerorder&gt;
                      &lt;type&gt;singleton&lt;/type&gt;
                      &lt;class&gt;company_printerorder/observer&lt;/class&gt;
                      &lt;method&gt;exportOrder&lt;/method&gt;
                  &lt;/company_printerorder&gt;
              &lt;/observers&gt;
          &lt;/sales_order_place_after&gt;
      &lt;/events&gt;
  </code></pre>
  
  <p>This is my Observer.php file:</p>
  
  <pre><code>class Company_PrinterOrder_Model_Observer 
  {
  
      public function exportOrder(Varien_Event_Observer $observer)
      {
  
      Mage::log('!!!!!!!!!!!!!!!!First line of the Observer!!!!!!!!!!!!!!!!');
  
      //**** I THINK MY PROBLEM IS HERE
      $event = $observer-&gt;getEvent()-&gt;getOrder()-&gt;getData();
      $observerdata = (get_class_methods($event));
      $observerdata = print_r($observerdata); 
  
  
  
  
      //Create text file
          // choose correct path
          $path = $_SERVER['DOCUMENT_ROOT'] . '/magento/printer/orders/';
          if (!is_dir($path)) {
  
              mkdir($path);
          }
  
          // create filename
          $orderId = Mage::getSingleton('checkout/type_onepage')
              -&gt;getCheckout()-&gt;getLastOrderId();
          $orderoverall = Mage::getModel('sales/order')-&gt;load($orderId);
          $orderNo = $orderoverall-&gt;getIncrementId();
  
          // format 20090403_141048_order_100000007_7.xml
          $filename = date('Ymd_His') . '_order_' . $orderNo . '_' . $orderId . '.txt';
  
          // create content
          $content = 'content here....' . $observerdata; // create TXT Data here
  
          // write file to server
          file_put_contents($path . $filename, $content);
  
  
      Mage::log('!!!!!!!!!!!!!!!!File has been created!!!!!!!!!!!!!!!!');
  
      Mage::log($observerdata);
  
      Mage::log('!!!!!!!!!!!!!!!!Just made a successful Observer!!!!!!!!!!!!!!!!');
      }
  }
  </code></pre>
  
  <p>When I place an order the output is simply just "1". i need to get all the order info exported so that the complete order can print out.</p>
  
  <p>The system log shows:</p>
  
  <pre><code>2013-12-11T06:29:18+00:00 ERR (3): Notice: Array to string conversion  in C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php on line 2814
  2013-12-11T06:29:18+00:00 ERR (3): Notice: Array to string conversion  in C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php on line 2814
  2013-12-11T06:29:19+00:00 ERR (3): Notice: Array to string conversion  in C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php on line 2814
  2013-12-11T06:29:19+00:00 ERR (3): Notice: Array to string conversion  in C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php on line 2814
  2013-12-11T06:29:21+00:00 DEBUG (7): !!!!!!!!!!!!!!!!First line of the Observer!!!!!!!!!!!!!!!!
  2013-12-11T06:29:21+00:00 DEBUG (7): !!!!!!!!!!!!!!!!File has been created!!!!!!!!!!!!!!!!
  2013-12-11T06:29:21+00:00 DEBUG (7): 1
  2013-12-11T06:29:21+00:00 DEBUG (7): !!!!!!!!!!!!!!!!Just made a successful Observer!!!!!!!!!!!!!!!!
  2013-12-11T06:29:22+00:00 DEBUG (7): SMTPPro is enabled, sending email in Aschroder_SMTPPro_Model_Email_Template
  2013-12-11T06:29:22+00:00 DEBUG (7): Development mode set to send all emails to contact form recipient: email@gmail.com
  2013-12-11T06:29:23+00:00 DEBUG (7): ReplyToStoreEmail is enabled, just set Reply-To header: email@gmail.com
  2013-12-11T06:29:23+00:00 DEBUG (7): Preparing the Google Apps/Gmail Email transport, email to send with is: email@gmail.com
  2013-12-11T06:29:23+00:00 DEBUG (7): Returning transport
  2013-12-11T06:29:23+00:00 DEBUG (7): About to send email
  2013-12-11T06:29:29+00:00 DEBUG (7): Finished sending email
  2013-12-11T06:29:29+00:00 DEBUG (7): template=sales_email_order_template
  </code></pre>
  
  <p>The file gets created; the content only shows:</p>
  
  <pre><code>content here....1
  </code></pre>
  
  <p>What am I missing or doing wrong?(still learning...) Any advise would be much appreciated.</p>
  
  <p>Thanks</p>