programatically change order status magento

require_once '../app/Mage.php';
umask(0);
Mage::app('default');

/*
    const STATE_NEW             = 'new';
    const STATE_PENDING_PAYMENT = 'pending_payment';
    const STATE_PROCESSING      = 'processing';
    const STATE_COMPLETE        = 'complete';
    const STATE_CLOSED          = 'closed';
    const STATE_CANCELED        = 'canceled';
    const STATE_HOLDED          = 'holded';
    const STATE_PAYMENT_REVIEW  = 'payment_review';
 */
$orderId = '200000120';
$order = Mage::getModel('sales/order')->loadByIncrementID($orderId);
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
$order->save();

echo "<br />Status Updated";
?>

Share on Facebook



4 thoughts on “programatically change order status magento”