Fn_Change_Order Status Not Working Since Upgrade


We use the website to also handle offline payments, such as cash and via PIN. We have a plugin that's supposed to take care of the order status of these orders, because otherwise the status will stay on waiting for payment.

This is the function, in the func.php file from the add-on:

function fn_quick_order_form_change_order_status(&$status_to, &$status_from, &$order_info, &$force_notification, &$order_statuses, &$place_order)
    $payment_method_ids = array(22,23);    
    if($status_to == "O" && $status_from == "N" && in_array($order_info['payment_id'], $payment_method_ids))
        $status_to = "C"; 

And it's registered in the init.php file:


Yet nothing happens. I've seen that in 4.6.2 the change_order hook has been changed a bit, but I don't know how to make it working again.

Thanks in advance.

Please make sure that payment methods IDs were not changed during upgrade process

I have - it's still 22 for cash and 23 for pin.

I would add some logging to veriffy that the full condition is being satisfied, especially the '$from_status field. There might be an intermediate step being generated that is affecting the condition.

I have - it's still 22 for cash and 23 for pin.


You can quickly check what's happening in this function. Just add this code in the function:

    fn_print_die($status_to, $status_from, $order_info['payment_id']);

Paste your IP and place order.

Since order statuses are updated by ajax, I suggest you to use the following code

fn_set_notification('E', __('notice'), 'TO: ' . $status_to . ' FROM: ' . $status_from . ' PAYMENT: ' . $order_info['payment_id']);

Adding either of those codes to my function doesn't actually do anything... it's as if it's never executed. I forgot a ; and the page didn't load anymore; so it does load func.php in but apparently the function is never called...

Putting die(); at the beginning of the function does nothing. So I assume it has something to do with the hook not being called, but then I would have to be looking into the core files... And I'm no expert unfortunately.

Then you most likely have a typo in your init.php where you call register_hooks() or you have register_hooks in a non-standard location and it's not being called.

Do other functions of the module work correctly after upgrade?