Showing posts with label Existing Order. Show all posts
Showing posts with label Existing Order. Show all posts

Friday 3 August 2018

How to add | update Shipping Price on existing order in Magento 1.9

$shippingamount = 10.00;
        try {
            $order = Mage::getModel('sales/order')->load(37881)
                    ->setShippingMethod('cstoreshipping_cstoreshipping')
                    ->setShippingAmount($shippingamount)
                    ->setBaseShippingAmount($shippingamount)
                    ->setShippingDescription('Shipping by third party');
            $order->setGrandTotal($order->getGrandTotal() + $shippingamount);
            $order->setBaseGrandTotal($order->getBaseGrandTotal() + $shippingamount);
            $order->save();
            pre($order->getData());
        } catch (Exception $e) {
            pre($e->getMessage());
        }