I get timeout when i try to change orderstatus in prestashop not sure what is missing.
QuoteI get timeout when i try to change orderstatus in prestashop not sure what is missing.
<?php
$sts_id = $_POST['status_id'];
$order_box = $_POST['orderBox'];
$selected_orders = implode(",", $order_box);
$get_orders = 'SELECT id_order FROM `' . _DB_PREFIX_ . 'orders` WHERE id_order in (' . $selected_orders . ') and current_state !=' . $sts_id;
$get_order_id = Db::getInstance()->ExecuteS($get_orders);if (count($get_order_id) > 0) {
$order_to_convert = array_column($get_order_id, 'id_order');
foreach ($order_to_convert as $odr_id) {
$objOrder = new Order($odr_id);
$history = new OrderHistory();
$history->id_order = (int) $objOrder->id;
$history->changeIdOrderState($sts_id, (int) ($objOrder->id));
}
}
Quote