1

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?

6

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();
}
  • Which location add this code 1.9.3 in magento? – Pankaj Upadhyay Feb 3 '17 at 6:11
0

You can try sending an invoice for each order without sending an email to the customer. Once the invoice is sent the order should switch to Processing.

0

Answer $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();

Syntax for setState public function setState($state, $status = false, $comment = '', $isCustomerNotified = null) { return $this->_setState($state, $status, $comment, $isCustomerNotified, true); }

Other Order State STATE_NEW STATE_PENDING_PAYMENT STATE_COMPLETE STATE_CLOSED STATE_CANCELED STATE_HOLDED

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.