I m trying to recalculate magento total using magento event observer after placing order.I m use below code to calculate total.
Observer Functon
public function recalculateTotal($observer)
{
//var_dump($observer->getOrder()->getData());exit;
$orderModel = $observer->getOrder();
//echo "<pre>";print_r($orderModel->getData());echo "</pre>";exit;
$saveModel = Mage::getModel('sales/order')->load($orderModel->getId());
$saveModel->setSurcharge(10);
$saveModel->setBaseSurcharge(10);
$saveModel->collectTotals();
$saveModel->save();
echo "<pre>";print_r($orderModel->getData());echo "</pre>";exit;
}
Event
<global>
<events>
<sales_order_place_after>
<observers>
<order_surcharge_display>
<type>singleton</type>
<class>surcharge/observer</class>
<method>recalculateTotal</method>
</order_surcharge_display>
</observers>
</sales_order_place_after>
</events>
</global>
But this is not working Please help.