When I have got and error "The Order State "complete" must not be set manually." I found the solution here ...
$order->save(); I use the obove code to change.
You can Change status this way.. $orderId = 1; // here order id $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order ...
Set order status programmatically:
Note : This blog will Guide you, how to create custom order statuses and change the order status programmatically as per need, so lets start,.
This method is in app/code/local/Mage/Sales/Model/Order.php (in v1.6.1) 938: public function setStateUnprotected($state, $status = false, ...
Method to Change Order Status Programmatically in Magento 2. In the code given below, change status in “Status Code” as per your business ...
Generally, it's only possible to cancel, hold and unhold pending orders. If you want to cancel an order with a 'Processing' status or 'Complete" ...
Magento: How to change order status programmatically?