Magento Asked by Asad Mazhar on December 26, 2021
How to restore order that have been cancelled.i’m having problems restoring cancelled-orders and recovering purchase request from order view page.is there any extension which can help me resolve this problem?
And if you want try to restore cancelled order by specific order id, you can try with below code:
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->get('MagentoSalesModelOrder')->load(162); //162 is your order id
$order->setState("processing")
->setStatus("processing")
->save();
$orderItems = $order->getAllItems();
foreach ($orderItems as $item) {
$item->setData("qty_canceled",0)->save();
}
Hope this solution will help you!
Answered by Faisal Sheikh on December 26, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP