0

In Magento 2.3.3, I want to set custom order status(Created new custom status and assigned to hold) while customer placing an order. I used below code in sales_order_place_after observer but it is not worked:

$orderState = Order::STATE_HOLDED;
$ordData = $this->_order->load($orderId);
$ordData->setState($orderState)->setStatus(Order::STATE_HOLDED);
$ordData->save();

Your Answer

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

Browse other questions tagged or ask your own question.