Changing Status In $Mode == 'update_Status' ?

Is it possible to use fn_change_order_status function a new status in if ($mode == 'update_status') { } in orders.pre.php ?fn_change_order_status

Like this:

if ($mode == 'update_status') {

fn_change_order_status($order_id, ‘X’);

}

You could run into a loop. What is your actual goal? I.e. what is the problem you are trying to solve (in addition to your solution to it).

Normally you would use the 'change_order_status' hook to catch a status change and then adjust the $to value to something different based on your logic.

I am trying to change order status to an another status acording to some procesess like this:

//requested status is 'K'
if ($mode == 'update_status') {

$value = 0;

if ($value ==1 ){
fn_change_order_status($order_id, ‘X’); //New status that should be changed
}

}

If the value is 1 then change order status not to 'K', but change to 'X'.

Again, I would use the 'change_order_status' hook and then look at the conditions/logic there that you want to apply

Again, I would use the 'change_order_status' hook and then look at the conditions/logic there that you want to apply

I got it. Thank you.