Merge branch 'ticket-10657-PhileaOptimization'

This commit is contained in:
Marion Muszynski 2016-12-14 11:30:42 +01:00
commit 199c56337b

View File

@ -454,7 +454,12 @@
$order->shipping_number = $parcel[0]; $order->shipping_number = $parcel[0];
$order->update(); $order->update();
if(in_array($order->id, $status_sent)) { $last_state = Db::getInstance()->getValue('
SELECT `id_order_state`
FROM `'._DB_PREFIX_.'order_state_current`
WHERE `id_order` ='.(int)$order->id
);
if(in_array($order->id, $status_sent) && (int)$last_state != 4) {
$history = new OrderHistory(); $history = new OrderHistory();
$history->id_order = (int) $order->id; $history->id_order = (int) $order->id;
$history->changeIdOrderState(4, (int) $order->id); $history->changeIdOrderState(4, (int) $order->id);