Это мой цикл для изменения состояния заказа.
Код: Выделить всё
foreach ($ordersIds as $orderId) {
$order = new Order($orderId);
if($order->current_state != $newStatusId) {
$history = new OrderHistory();
$history->id_order = (int)$order->id;
$history->changeIdOrderState($newStatusId, $order);
$history->addWithemail(true);
$history->save();
}
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... ge-problem
Мобильная версия