$class_o->updateOrderItemMode($oiid_array, 'MTO'); } } } } //end foreach orders loop /* * RESET PRIORITY FOR MMO BACK TO NORMAL * Update is canceled, just realise that there will be no MMO from SP/JG orders query because * they will be cleared after stock HH check and the DP will be used for stock checking */ //INCLUDE DEPOT ORDERS FROM HERE foreach ($oi_depot as $oiid => $oi) { //SAVE CURRENT ITEM STARS FOR NEW ORDERS IF NOT YET SET BEFORE if ($oi['status'] == '1' && $oi['products_stars'] == 0 && $oi['stars'] > 0) { $class_do->updateStars($oiid, $oi['stars']); } //OTHER THEN ZALANDO, ORDERS NEED TO BE HOLD FOR A SPECIFIC TIME ($duration_hold_not_zalando_orders), DO RULE BASED ON ORDER DATE $transid = $oi['trans_type'] . '-' . $oi['trans_id']; $do_timestamp = strtotime($oi['order_date']); $import_timestamp = isset($temp_import_timestamp[$transid]) ? $temp_import_timestamp[$transid] : $do_timestamp; if (isset($temp_jng_sp_id[$transid]) && $temp_jng_sp_id[$transid] == '8' || $timestamp_raw > $import_timestamp + $duration_hold_not_zalando_orders) { $priority = $oi['trans_type'] == '' ? $oi['type'] : $oi['trans_type']; //Use order date of original order for priority of MMO, use depot order date for other orders $priodate = isset($temp_order_date[$transid]) ? $temp_order_date[$transid] : date($priority_date_format, $do_timestamp); $order_key = $orders_priority[$priority] . $priodate . $oi['type'] . 'O' . $oiid; $oi['order_quantity'] = intval($oi['quantity']); $oi['products_articles_id'] = $oi['articles_id']; if (!isset($orders[$order_key])) { $orders[$order_key] = array(); }