Ok, I see…
It depends where exactly you want to put this on the invoice, there are multiple action hooks available.
You can try this:
add_action( 'wpo_wcpdf_after_order_data', 'display_booking_date_in_invoice', 10, 2 );
function display_booking_date_in_invoice( $template_type, $order ) {
$items = $order->get_items();
if ( $items ) foreach ( $items as $item_id => $item ) {
echo '<tr>';
echo '<th>' . __( 'Date de livraison:', 'wpo_wcpdf' ) . '</th>';
echo '<td>' . wc_get_order_item_meta( $item_id, '_ebs_start_display', true ) . '</td>';
echo '</tr>';
}
}
This will display what you need under the order information.
Please note that booking dates are stored per item, and not per order, which means that if you have several booked items in your order it will display several dates.
Edit: Don’t put the code directly in the invoice.php file but in your theme’s functions.php.
-
This reply was modified 8 years, 1 month ago by
Ashanna.
-
This reply was modified 8 years, 1 month ago by
Ashanna.