<?php
$orderId = YOUR_ORDER_ID;
$order = Mage::getModel('sales/order')->load($orderId);
/**
* change order status to 'Completed'
*/
$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true)->save();
/**
* change order status to 'Pending'
*/
$order->setState(Mage_Sales_Model_Order::STATE_NEW, true)->save();
/**
* change order status to 'Pending Paypal'
*/
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
/**
* change order status to 'Processing'
*/
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
/**
* change order status to 'Completed'
*/
$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true)->save();
/**
* change order status to 'Closed'
*/
$order->setState(Mage_Sales_Model_Order::STATE_CLOSED, true)->save();
/**
* change order status to 'Canceled'
*/
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->save();
/**
* change order status to 'Holded'
*/
$order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true)->save();
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.