If you want to show the delivery date, time or location in a custom template or Email in WooCommerce you have to options. First, you simply go into your template file and add a code to get the meta and output it like this:

$deliveryDate = get_post_meta($orderID, 'delivery_date', true);
echo $deliveryDate;

Second would be to add the code below into your functions.php of your child theme. Then you can use the following shortcode in any page builder for example:

And here it is in shortcode form to be added to the functions.php file: 
// function that runs when shortcode is called
function ddoutput_shortcode($atts) {
 
$orderId = $atts['orderid']:
// Things that you want to do.
 $deliveryDate = get_post_meta($orderId, 'delivery_date',true);

// Output needs to be return
echo $deliveryDate;
}
// register shortcode
add_shortcode('deliverydate', 'ddoutput_shortcode');

When using the shortcode make sure you add the orderid parameter.

Leave a Reply

Your email address will not be published. Required fields are marked *