Add Delivery Date And Time To WooCommerce PDF Invoices & Packing Slips By WP Overnight
To add the delivery date and time from WooCommerce Delivery Slots to your invoices and packing slips generated by the “WooCommerce PDF Invoices & Packing Slips” by WP Overnight, you can use the following code.
To use the code, add it to your child theme’s functions.php file.
<?php
/**
* Add Date and Time Slots to Invoices
*/
function iconic_wpo_wcpdf_delivery_date( $template_type, $order ) {
if ( $template_type !== 'packing-slip' ) {
return;
}
$date = $order->get_meta( 'jckwds_date' );
$time_slot = $order->get_meta( 'jckwds_timeslot' );
?>
<tr class="iconic-delivery-date">
<th><?php _e( 'Order Slot:', 'iconic' ); ?></th>
<td>
<?php echo $date; ?><br>
<?php echo $time_slot; ?>
</td>
</tr>
<?php
}
add_action( 'wpo_wcpdf_after_order_data', 'iconic_wpo_wcpdf_delivery_date', 10, 2 );WooCommerce Delivery Slots
Let customers choose their preferred WooCommerce delivery date and time right from your WooCommerce checkout page. With WooCommerce Delivery Slots, you can set a flexible delivery schedule to suit you and your customers.
Was this helpful?
Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.