Rene Hansen

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Rene Hansen
    Participant

    Yes Barry all good here : )

    • This reply was modified 6 years, 4 months ago by Rene Hansen.
    Rene Hansen
    Participant

    Hi Barry,

    Yup and it didn’t make sense to me, but when I created more users and they bought tickets. I could see that the call returned all attendees. That could actually be a use case. It was not what I needed so I added the event_id again and it worked.

    Php Storm also complained about the line but no error was thrown. Not even in the error log.

    My method is used for a shortcode:

    public function handle_attendees_shortcode($att){
    
         $output = '';
    
         if (isset($att['id']) 
               && class_exists('Tribe__Tickets__Tickets') 
               && function_exists( 'tribe_tickets_get_attendees' ) ) {
    
            $attendees = Tribe__Tickets__Tickets::get_event_attendees( intval($att['id']) );
    
            $output .= '<div class="row">';
            $output .= '<div class="col-md-3"><h5>Deltagere / købere</h5></div>';
            $output .= '</div>';
            $output .= '<div class="row">';
                    $pid = 0;
                
                    foreach ( $attendees as $attendant ) {
                        //$output .= '<pre>' . print_r( $attendant ) . '</pre>';
                        $output .= '<div class="col-md-3">' . $attendant['purchaser_name'] . '<br>' . 
                        $attendant['purchaser_email'] . '</div>';
                        $eid = $attendant['event_id'];
                     }
    
                $output .= '</div>';
        }
    
        $output .=
        '<div class="riiso-attendees-list">
            <form method="post">
                
                
            </form>
        </div>';
            return $output;
        }

    The shortcode is called from: plugins/the-events-calendar-community-events/src/views/community/event-list.php (and I am using it as a template file – i have added shortcode and send event->ID to the shortcode.

    Hope it makes sense.

    Best regards Thomas

    Rene Hansen
    Participant

    I found a solution myself : )

Viewing 3 posts - 1 through 3 (of 3 total)