Update Order Total After Order Placement in Magento 1.9

databasemagento-1.9orderstotals

I created a custom charges on order for some specific products, Unfortunately custom charge was not updated in order total like cash on delivery,

Is there any way to update orders totals after order created without cancel order?

Best Answer

I think you can do this just like you would modify any other model instance.

$item = Mage::getModel('sales/order_item')->load(id here);
$item->setPrice(40)->setBasePrice(40)->save();

then

$order = Mage::getModel('sales/order')->load(order id here);
$order->setSubtotal(70)->setBaseSubtotal(70);
$order->setDiscountAmount(7)->setBaseDiscountAmout(7);
$order->setGrandTotal(63)->setBaseGrandTotal(63);
$order->save();

You might also need to change other values like tax, subtotal_incl_tax and others.

But this is a bad practice and you should not do it. It is better just to cancel the order and create a new one.

Related Topic