title: How to display Custom order attribute in Magento back end
body: <p>I'm using Magento 1.7 - I am fairly new to Magento module development.</p>
  
  <p>I have created a new Order custom EAV attribute called Deliverydate which the customer will enter on the Shopping Cart page. I created a custom module and installer script, and can see it in the eav_attribute table.</p>
  
  <pre><code>$installer = $this;
  $installer-&gt;startSetup();
  $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
  
  $setup-&gt;addAttribute('order', 'deliverydate', array(
   'position'      =&gt; 1,
   'input'         =&gt; 'text',
   'backend_type'  =&gt; 'varchar',
   'type'          =&gt; 'varchar',
   'label'         =&gt; 'Choose delivery date',
   'visible'       =&gt; 1,
   'required'      =&gt; 0,
   'user_defined' =&gt; 1,
   'global'        =&gt; 1,
   'visible_on_front'  =&gt; 1,
  ));
  
  $installer-&gt;endSetup();
  </code></pre>
  
  <p>But I've read many sources and can't figure out how to 
  1) Save the value entered by the customer.
  2) Retrieve the value for display in the Admin.</p>
  
  <p>I have read on these tutorials about Observers but can't seem to get one to work:</p>
  
  <p>Here's my config.xml file</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
    &lt;modules&gt;
      &lt;Mycompany_Deliverydate&gt;
        &lt;version&gt;0.1.0&lt;/version&gt;
      &lt;/Mycompany_Deliverydate&gt;
    &lt;/modules&gt;
    &lt;global&gt;
  &lt;resources&gt;
    &lt;deliverydate_setup&gt;
      &lt;setup&gt;
        &lt;module&gt;Mycompany_Deliverydate&lt;/module&gt;
        &lt;class&gt;Mycompany_Deliverydate_Model_Resource_Mysql4_Setup&lt;/class&gt;
      &lt;/setup&gt;
      &lt;connection&gt;
        &lt;use&gt;core_setup&lt;/use&gt;
          &lt;/connection&gt;
        &lt;/deliverydate_setup&gt;
      &lt;/resources&gt;
      &lt;events&gt;
      &lt;checkout_type_onepage_save_order&gt;
          &lt;observers&gt;
              &lt;Deliverydate_observer&gt;
                  &lt;type&gt;singleton&lt;/type&gt;
                  &lt;class&gt;deliverydate/observer&lt;/class&gt;
                  &lt;method&gt;Deliverydate&lt;/method&gt;
              &lt;/Deliverydate_observer&gt;
          &lt;/observers&gt;
      &lt;/checkout_type_onepage_save_order&gt;
       &lt;/events&gt;
     &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>And my Observer.php file, most of which I borrowed from another tutorial / question on this site.</p>
  
  <pre><code>class Mycompany_Deliverydate_Model_Observer {
    public function Deliverydate($observer) {
  
      $event = $observer-&gt;getEvent();
      $order = $event-&gt;getOrder();
  
      $order-&gt;setDeliverydate(Mage::app()-&gt;getRequest()-&gt;getPost('delivery_date'));
  
  
    }
  }
  </code></pre>
  
  <p>I don't think this is being entered at all - I put in a <code>throw new Exception</code> and went through an entire order without ever seeing the exception. In any case I am not sure I'm checking the right event - checkout_type_onepage_save_order - when is this fired? And I don't know where the <code>setDeliverydate()</code> function would be defined but as I said this sort of comes from another source and it wasn't defined there either.</p>
  
  <p>And where does the value entered get stored? </p>