I recently have the problem that the yellow block with the total order on the bottom right of the sale order info page stays empty. I looked into the files and found out that in /app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml the following lines should display the content

<div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
<div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>

The divs are shown, but the second one is empty, so $this->getChildHtml('order_totals') doesn't do anything. In the other *.phtml files everything seems ok, but in the layout sales.xml file i find things like this:

<block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
    <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
    <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
        <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
        <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
        <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
        <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
            <action method="setSourceField"><value>giftcert_amount</value></action>
            <action method="setLabel"><value>Gift Certificate</value></action>
        <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
            <action method="setSourceField"><value>adjustment_positive</value></action>
            <action method="setLabel"><value>Adjustment Refund</value></action>
        <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
            <action method="setSourceField"><value>adjustment_negative</value></action>
            <action method="setLabel"><value>Adjustment Fee</value></action>

So all the item files are commented out, but the overview should work, i think. Still I uncommented it but it doesn't make any difference.

What do I have to do that the order totals are shown?

  1. Check wether there is a child block with the name order_totals.
  2. If there is not, check wether your XML is loaded (break the XML, then a SimpleXMLException should be thrown)
  3. Check whether you template is loaded (just put a echo '222' in the first line)

And as always: Check system.log and exception.log missing templates are shown there if you are in developer mode.

| improve this answer | |
  • What exactly do you mean with 'child block' ? The XML is loaded The info.phtml is loaded, but not the totals.phtml, which should be loaded by <?php echo $this->getChildHtml('order_totals') ?> – user1950929 Mar 26 '13 at 10:38
  • the method getChildHtml() makes all the rendering and stuff, the question is: is there a block. you can check with echo get_class($this->getChild('order_totals')); – Fabian Blechschmidt Mar 26 '13 at 10:51
  • This doesn't output anything. Is there a method to get the name of the current block? – user1950929 Mar 26 '13 at 10:59
  • $this->getNameInLayout(), try a var_dump() instead. If the block is not found false is returned. And if you echo false, there is no output - but this you know for sure :) – Fabian Blechschmidt Mar 26 '13 at 11:07
  • yup you're right, it returns false. I checked getNameInLayout() and it returns order_tab_info. In the sales.xml file (I assume this is the file where the blocks are defined for that section) I find a block with name order_tab_info and it has a child named order_totals, see my original post for that block code. – user1950929 Mar 26 '13 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.