I have a website with 2 plugins that use the woocommerce_checkout_order_processed
hook.
Plugin 1 uses the hook with priority 10 like so:
add_action('woocommerce_checkout_order_processed', [$this, 'add_delivery_data_to_order'], 10, 3);
and saves meta data to the order using:
$order->update_meta_data('test','true');
$order->save();
Plugin 2 uses the hook with priority 100 like so:
add_action('woocommerce_checkout_order_processed', [$this, 'get_delivery_data_to_order'], 100, 3);
and gets the meta data from the order using:
$order->get_meta_data();
For some reason Plugin 1 doesn't manage the save the data in time so when Plugin 2 tries to pull the meta data, it's empty.
Now, if I use the same hook from Plugin 1 in the child theme, it works. What could cause Plugin 1 not to be able to save the data on time?
Thanks