Woocommerce Bookings get person count by type

Viewed 21

For each of my bookings, I am trying to display a breakdown of person numbers by person type.

So far, I have been able to use the get_persons_total() function to display the total number of persons per booking - however, I have 3 person types (Child, Adult, Baby) and I'd like to be able to separate my person counts by type (or ID)...something like get_persons_total(ID) would be perfect.

Here is the code that fetches the total person count:

$person_count = $booking->get_persons_total();
    if ( !empty( $person_count ) ) {
        $booking_person_count = $person_count;
    } else {
        $booking_person_count = '0';
    }
0 Answers
Related