$orderId = $orderId;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
$order->setState(\Magento\Sales\Model\Order::STATE_NEW, true);
$order->setUpdate_at(date('2017-03-20 10:14:23', time() - 60*60*24));
$order->addStatusToHistory($order->getStatus(), 'Awaiting Stock');

1 Answer 1


For me

Its not good to use the object manager. Instead you can use the Magento\Sales\Model\OrderRepository to load the order You can use the get($entityId) method . And then you can try $order->addCommentToStatusHistory($comment, $status = false, $isVisibleOnFront = false); $order->save() .

Note addStatusToHistory addStatusHistoryComment are deprecated

Hope this will help


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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