I want to display the end date of the booking as well as the start date. Now so far I have the following:
add_filter( 'woocommerce_get_item_data', 'display_booking_date', 10, 2 );
function display_booking_date( $item_data, $cart_item ){
if ( ! empty( $cart_item['booking'] ) ) {
$date_format = apply_filters( 'woocommerce_bookings_date_format', wc_date_format() );
$end_date = apply_filters( 'woocommerce_bookings_get_end_date_with_time', date_i18n( $date_format, $cart_item['booking']['_end_date'] ) );
$item_data[] = array(
'key' => __( 'End Date', 'your-textdomain' ),
'value' => $cart_item['booking']['_end_date'],
'display' => $end_date,
);
}
return $item_data;
}
This allows me to display the end date of a booking. However, this is after any other meta data which isn't what I want. Is there a way that I could either:
1) Change where the end date appears so that it appears after the Start Date and not after all of the other meta data
2) Even better would be to have the start and end date together as the same bit of meta data.
Thanks!