When creating a Woocommerce order using the "Add Order" screen in the Wordpress admin, if I retrieve the order using wc_get_order() in a callback attached to woocommerce_process_shop_order_meta, I have noticed that the Customer ID is 0 - despite the fact that I have selected a customer. The code I am writing uses this data to sync to an external API so my question is: Why is this ID empty and is there a way to get the correct ID?
A simplified version of the code would be:
add_action('woocommerce_process_shop_order_meta', 'processOrder', 10, 1);
function processOrder($order_id){
$order = wc_get_order($order_id);
die(print_r($order->get_customer_id(),1));
}