How To Change An Order Status With A PHP Script In Prestashop


With below nice PHP code you can easily change the order status inside the DisplayOrderConfirmation hook.

With below nice PHP code you can easily change the order status inside the DisplayOrderConfirmation hook.
public function hookDisplayOrderConfirmation($params)
{
 .......
 $objOrder = new Order($id_order);
 $history = new OrderHistory();
 $history->id_order = (int)$objOrder->id;
 $history->changeIdOrderState(6, (int)($objOrder->id));
 $history->add(true);
 .......
}

Post a Comment

0 Comments