How change order information on success order: Magento

Hello Friends!

Hope you all are doing well!

I am here going to describe you a important Magento script for change the order information on success order.

Using my script, you can easily update recent order information like “customer group”, “payment status”, “order confirmation” etc.

/** Change Custom Payment Status */
                $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
                $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
                $order->setData('state', 'complete');
                $history = $order->addStatusHistoryComment('Order was set to Complete by our automation tool.', false);
           /* End payment status */


Enjoy script! 🙂


Sr. Software Engineer

Tagged with: , , , ,
Posted in Magento

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Recent Posts
%d bloggers like this: