I am using jdump to check.
And I confirm, when creating an order with confirmed status as default status on bank transfer, onAfterOrderCreate is triggered once, onAfterOrderUpdate is triggered twice.
But my sql DB is not updated this way, even if th code is working well when updating manually.
Something is wrong in my code, not same variable I guess when updating manually.
I will check.
Many thanks for your help.
edit :
OK, I can see why it is not working.
in the code, I need the userid.
I am using the following :
$orderClass = hikashop::get('class.order');
$dbOrder = $orderClass->get($order->order_id);
$orderClass=$orderClass->loadFullOrder($order->order_id, false, false);
Then $orderClass->customer->id is the userid.
This code works when manually changing the status.
But it does not work when the order is created the proper way (by the user, frontend side, bank transfer payment).
There is no customer property for $orderClass.
What do I miss here ?