The order is created with a custom function ‘create_partial_order’ in the WC_Vipps_Gateway class. The reason for this is that the normal checkout order creation requires a shipping method to be present.
This may change in the future (replacing the current ‘partial’ orders with standard orders with pro forma shipping methods), but in the meantime you can hook into the action
‘woocommerce_checkout_update_order_meta’ (the standard filter)
or use
‘woo_vipps_before_process_payment’ ($order_id) and check WC_Gateway_Vipps::instance()->$express_checkout (which should be true).
I realize this is clumsy; would it be better to create a new action ‘woo_vipps_express_checkout_order_created’ to modify the order after creation? I can add this fairly quickly if preferred.
Thank you for respons..
Yes, adding new action would be cleaner option, I can add custom code on function.jsp for action “woo_vipps_express_checkout_order_created”
If you can do this quickly then that will be nice.
I’ll look into it ASAP and create some more actions for this usecase.
'woo_vipps_before_create_express_checkout_order'
'woo_vipps_express_checkout_order_created'
will now run before and after an express checkout order has been created, and before process_payments is run.
This should now actually be fixed from version 1.3.7 on – calculation of fees was indeed missing in express checkout, but is now present. Marking this as resolved.