Magento – How to Set Order Status to “Processing”

magento-1.9order-status

We recently migrated a Magento site and, for some reason, an unknown a number of orders that were paid for are still marked as Pending (status) in the Magento admin panel.

I need to be able to change the status to Processing so that back office staff can view invoices, print packing sheets etc, but I am unable to change the order status. Is there a way to do this?

Best Answer

The reason that your Pending order cannot be switched to Processing is that Pending order status has pending order state associated with it. Processing status has processingstate associated with it in default Magento.

Order states cannot be changed in the admin panel, as it disrupts the business logic of Magento. So, you should only manually change state when you really need to, as in your case.

You'll need to load a collection of orders with the order numbers you have identified.

$orderNumbers = ...; // comma-delimited order numbers
$collection = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('incremend_id', array('in' => $orderNumbers));
foreach ($collection as $order) {
    $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING)
        ->setStatus(Mage_Sales_Model_Order::STATE_PROCESSING)
        ->save();
}
Related Topic