title: Magento Observer Inject Data Into Block
body: <p>I have:</p>
  
  <ol>
  <li>Created an event observer for core_block_abstract_to_html_after</li>
  <li>Waited for class "Mage_Adminhtml_Block_Sales_Order_Totals" in an if statement</li>
  <li>got the block via the observer and called addTotal();</li>
  </ol>
  
  <p>This is where I am stuck... If I dump the block I can see my newly added total HOWEVER its not showing in the HTML. Surely there has to be a way to "refresh" the HTML or something so that it will include the newly added data. Here is the code I have thus far...</p>
  
  <pre><code>&lt;?php
  class Company_Extension_Model_Totals {
  
      public function blockToHtmlAfter(Varien_Event_Observer $observer){
          $block = $observer-&gt;getBlock();
          $class = get_class($block);
  
          if($class == 'Mage_Adminhtml_Block_Sales_Order_Totals'){
              $transport = $observer-&gt;getTransport();
  
              $block-&gt;addTotal(new Varien_Object(array(
                  'code'      =&gt; 'newmethod',
                  'value'     =&gt; '10',
                  'base_value'=&gt; '10',
                  'label'     =&gt; 'New Method',
                  'area'      =&gt; 'footer'
              )), 'last');
  
              #$transport-&gt;setHtml($output);
          }
  
      }
  
  }
  ?&gt;
  </code></pre>