Hi @deindorfleben,
Could you try the following code snippet:
//Add booking person count to item meta
add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_add_person_count', 10, 3 );
function wpo_wcpdf_add_person_count ( $template_type, $item, $order ) {
if ( $template_type == 'invoice' && is_callable( 'WC_Booking_Data_Store::get_booking_ids_from_order_id') ) {
$booking_data = new WC_Booking_Data_Store();
$booking_ids = $booking_data->get_booking_ids_from_order_id( $order->get_id() );
foreach ( $booking_ids as $booking_id ) {
$booking = new WC_Booking( $booking_id );
$product_id = $booking->get_product_id();
if ( $booking->get_order_item_id() == $item['item_id'] ) {
$product = wc_get_product( $product_id );
$person_types = $product->get_person_types();
$person_counts = $booking->get_person_counts();
foreach ( $person_counts as $person_id_count => $person_count ) {
foreach ( $person_types as $person_id_type => $person_type ) {
if ( $person_id_count == $person_id_type ) {
echo sprintf("<span class='booking-variation'>%s - %sx<br></span>", $person_type->get_name(), $person_count );
}
}
}
}
}
}
}
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