Hi @gerard04,
It looks like the Woo Delivery plugin is storing the delivery data in the total rows for some reason. You can hide them in the totals table on your PDFs and add them to the order data table via the following code snippet:
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_add_woo_delivery_data', 10, 2 );
function wpo_wcpdf_add_woo_delivery_data( $template_type, $order ) {
$document = wcpdf_get_document( $template_type, $order );
$delivery_data = array( 'delivery_date', 'delivery_time', 'pickup_date', 'pickup_time' );
foreach( $document->get_woocommerce_totals() as $key => $total ) {
if ( in_array( $key, $delivery_data ) ) {
?>
<tr class="woo-delivery">
<th><?php echo $total['label']; ?></th>
<td><?php echo $total['value']; ?></td>
</tr>
<style>table.totals tr.<?php echo $key; ?> { display: none; }</style>
<?php
}
}
}
This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you haven’t worked with code snippets or functions.php before please read this: How to use filters