When I send the order to an external delivery service (API), I get the answer:
$delivery_order_id = '100678'
.
In this matter, these data are stored in metadata.
How to display this value in the admin panel Woocommerce?
When I send the order to an external delivery service (API), I get the answer:
$delivery_order_id = '100678'
.
In this matter, these data are stored in metadata.
How to display this value in the admin panel Woocommerce?
This can be done using dedicated hooks like woocommerce_admin_order_data_after_order_details
this way:
add_action( 'woocommerce_admin_order_data_after_order_details', 'admin_order_display_delivery_order_id', 60, 1 );
function admin_order_display_delivery_order_id( $order ){
$delivery_order_id = get_post_meta( $order->get_id(), 'delivery_order_id', true );
$delivery_id = ! empty( $delivery_order_id ) ? $delivery_order_id : '<span style="color:red">' .__('Not yet.') . '</span>';
echo '<br clear="all"><p><strong>'.__('Delivery Order Id').':</strong> ' . $delivery_id . '</p>';
}
Code goes in function.php file of your active child theme (or active theme). Tested and works.