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');
                $order->setStatus('complete');   
                $history = $order->addStatusHistoryComment('Order was set to Complete by our automation tool.', false);
                $history->setIsCustomerNotified(true);
                $order->save();
           /* End payment status */

 

Enjoy script! 🙂

Advertisements

Sr. Software Engineer

Tagged with: , , , ,
Posted in Magento

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: