Magento 1.9 – How to Add Value in Custom Column of sales_flat_order Table

magento-1.9sales-order

Hi i have made a custom column in sales_flat_order table named final_shipping_amount. When i am loading order its showing my custom column in it. I am trying to add value in my custom column but its not adding value in it here is my code.

$final_shipping = "1.33"
$orderIid = $this->getRequest()->getParam('id');
$orderDataShip = Mage::getModel('sales/order')->load($orderIid);
$orderDataShip->setFinalShippingAmount($final_shipping);
$orderDataShip->save();

Its not saving value in it. i have also tried this way but also its not saving

$final_shipping = "1.33"
$orderIid = $this->getRequest()->getParam('id');
$orderDataShip = Mage::getModel('sales/order')->load($orderIid);
$orderDataShip->setData('final_shipping_amount' , $final_shipping);
$orderDataShip->save();

but its not working.

Best Answer

Try clearing the Magento cache (both the Magento cache and Storage cache)..or you can simply delete the files from var/cache.

Related Topic