$old_status = $order_info['status']; if (fn_change_order_status($_REQUEST['id'], $_REQUEST['status'], '', fn_get_notification_rules($_REQUEST))) { $order_info = fn_get_order_short_info($_REQUEST['id']); fn_check_first_order($order_info); $new_status = $order_info['status']; if ($_REQUEST['status'] != $new_status) { Registry::get('ajax')->assign('return_status', $new_status); Registry::get('ajax')->assign('color', fn_get_status_param_value($new_status, 'color')); fn_set_notification('W', __('warning'), __('status_changed')); } else { fn_set_notification('N', __('notice'), __('status_changed')); } } else { fn_set_notification('E', __('error'), __('error_status_not_changed')); Registry::get('ajax')->assign('return_status', $old_status); Registry::get('ajax')->assign('color', fn_get_status_param_value($old_status, 'color')); } if (empty($_REQUEST['return_url'])) { exit; } else { return array(CONTROLLER_STATUS_REDIRECT, $_REQUEST['return_url']); } } return array(CONTROLLER_STATUS_OK, 'orders' . $suffix); } $params = $_REQUEST; if ($mode == 'print_invoice') { if (!empty($_REQUEST['order_id'])) { fn_print_order_invoices($_REQUEST['order_id'], !empty($_REQUEST['format']) && $_REQUEST['format'] == 'pdf'); } exit;
$old_status = $order_info['status']; if (fn_change_order_status($_REQUEST['id'], $_REQUEST['status'], '', fn_get_notification_rules($_REQUEST))) { $order_info = fn_get_order_short_info($_REQUEST['id']); fn_check_first_order($order_info); $new_status = $order_info['status']; if ($_REQUEST['status'] != $new_status) { Tygh::$app['ajax']->assign('return_status', $new_status); Tygh::$app['ajax']->assign('color', fn_get_status_param_value($new_status, 'color')); fn_set_notification('W', __('warning'), __('status_changed')); } else { fn_set_notification('N', __('notice'), __('status_changed')); } } else { fn_set_notification('E', __('error'), __('error_status_not_changed')); Tygh::$app['ajax']->assign('return_status', $old_status); Tygh::$app['ajax']->assign('color', fn_get_status_param_value($old_status, 'color')); } if (empty($_REQUEST['return_url'])) { exit; } else { return array(CONTROLLER_STATUS_REDIRECT, $_REQUEST['return_url']); } } return array(CONTROLLER_STATUS_OK, 'orders' . $suffix); } $params = $_REQUEST; if ($mode == 'print_invoice') { if (!empty($_REQUEST['order_id'])) { fn_print_order_invoices($_REQUEST['order_id'], !empty($_REQUEST['format']) && $_REQUEST['format'] == 'pdf'); } exit;