I have a use case where I need to update the order status (e.g. set to 'completed). In magento one I just called setStatus and then save
$order>setState('your_state') $order->setStatus($status); $order->save();
But for magento 2 I get "function setStatus not found"
How do I update order fields such as status and other fields in Magento 2?
Solved! Go to Solution.
This is just your inaccuracy.
The \Magento\Sales\Model\Order has the setStatus method: https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Sales/Model/Order.php#L3306-L3309
my bad...not calling setState correctly (forgot hyphen "-") using $order>setState(), should be $order->setState()