I'm using the code like this:
$current_status = $bill_api->getDocument($order['order_invoice_number']);
if ($current_status->getPaymentStatus() == 'paid') {
$orderObj = new stdClass();
$orderObj->order_id = (int)$order['order_id'];
$orderObj->order_status = 'confirmed';
$orderObj->history = new stdClass();
$orderObj->history->history_notified = 1;
$orderObj->history->history_reason = "Invoice ready";
$orderObj->history->history_type = "modification";
$orderClass = hikashop_get('class.order');
$orderClass->save($orderObj);
}
Where $current_status coming from the billing software. When it's paid there, it's changing the status in the webshop to confirmed and add the history as well...works well..
But looks like the onAfterOrderUpdate event not running after this, as I have there a code with:
if($order->order_status != $order->old->order_status){
if($order->order_status == "confirmed"){
}
}
which is not happening just when I change the status on the admin.
Should I add any code to run the event?