How To Change Order Status Id Programatically In Prestashop

If you need to change order status id programtically for an order you need to complete few steps but nothing very complicated, you only need the order id where the status will be changed and the new status id you need to change.

In the below code we will change the status for order which has id 10 with our new status 1.

$main_order = new Order(10); 
$order_history = new OrderHistory();
$order_history->id_order = (int)$main_order->id;
$order_history->changeIdOrderState(1, (int)($main_order->id));

That's all you need to do in order to change the order status id for an order in prestashop

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x