I am a newbie in Magento development.

Do you know how to add a new row to totals in admin order view to show the resulting computation of subtotal + shipping?

I create path folder with Sketchkode/Totalgst/etc/config.xml


After I create Based on config Sketchkode/Totalgst/Block/Adminhtml/Sales/Order/Totals.php

  class Sketchkode_Totalgst_Block_Adminhtml_Sales_Order_Totals extends Mage_Adminhtml_Block_Sales_Order_Totals{
     * Initialize order totals array
     * @return Mage_Sales_Block_Order_Totals
     protected function _initTotals()



    if ($amount) {
        $this->addTotalBefore(new Varien_Object(array(
            'code'      => 'fee',
            'value'     => $amount,
            'base_value'=> $amount,
            'label'     => $this->helper('sales')->__('Fee'),
        ), array('shipping', 'tax')));

    return $this;

I get blank Order Totals

enter image description here

1 Answer 1


There were be three possible problem of That

  1. You missed spelled the directory name
  2. cache problem (delete the cache)
  3. 'code' => 'fee', your code is already used by other ext so changes it something unique code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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