I used many update methods for update values in sales_flat_order and sales_flat_order_grid tables, but no method didn't work.
I don't know why the update is not done.
Method 1:-
$coreResource = Mage::getSingleton('core/resource'); $write = $coreResource->getConnection('core_write'); $_field_flat_order =array(); $_field_flat_order['grand_total'] = $order_gt; $_field_flat_order['base_grand_total'] = $order_gt; $_field_flat_order['discount_amount'] = $order_discount; $_field_flat_order['base_discount_amount'] = $order_discount; $_field_flat_order['discount_description'] = "1%"; $write->update($coreResource->getTableName('sales_flat_order'),$_field_flat_order,array('entity_id = ?' => $order_id,));
Method 2:-
$order_data=Mage::getModel('sales/order')->loadByIncrementId($increment_id); $order_data->setGrandTotal($order_gt); $order_data->setBaseGrandTotal($order_gt); $order_data->setBaseDiscountAmount($order_discount); $order_data->setDiscountAmount($order_discount); $order_data->setDiscountDescription("1%"); $order_data->save();
Method 3 :-
$sql_order = "UPDATE sales_flat_order SET grand_total='".$order_gt."',base_grand_total='".$order_gt."',discount_amount='".$order_discount."',base_discount_amount='".$order_discount."',discount_description='1%' WHERE entity_id ='".$order_id."'"; $write->query($sql_order);
No method didn't work, but all other tables are updating perfectly.
Anyone know the reason.?