Updating Order Status Programatically Results in Order Number Change
-
I am currently using the sequential order number plugin on a site I developed. Everything has been working great until recently. I have a snippet in my code that looks like this:
$order = wc_get_order($arrayItem[0]) // $arrayItem[0] is my Order ID
$order->add_order_note($noteContents);
$order->update_status(‘completed’);
$order->save();Again, I had no issues with this code until recently, but now whenever I try to update a status programatically (using update_status() ), the order NUMBER changes for whichever order had its status updated. I tried also using the “new WC_Order” method to get my order object to see if this would make a difference, but it did not.
There must be a way to achieve updating the status programatically without affecting the order number, but I could use some help narrowing down the solution. Any help is much appreciated and please let me know if any further information might be needed to resolve my issue.
Thank you!
- The topic ‘Updating Order Status Programatically Results in Order Number Change’ is closed to new replies.