Code to print out all events plus the tickets for each event all at once

Home Forums Calendar Products Events Calendar PRO Code to print out all events plus the tickets for each event all at once

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1214922
    Jeff
    Participant

    I’m trying this code to get all the events between the two dates which works, but I also want all the RSVP tickets for each event which doesn’t work. The file attendees-email.php gets all the tickets for an event, but I’m confused how to load the variables properly on my own and am clearly missing something. I don’t know how to get the ticketing data for each event…The $items variable is possibly the problem.

    <?php;
       global $post;	// Ensure the global $post variable is in scope
       $events = tribe_get_events( array(
    		'start_date'     => date( '2016-01-01 12:00:00' ),
    		'end_date'       => date( '2026-12-31 12:00:00' ),
    		'eventDisplay'   => 'custom',
    		'posts_per_page' => -1
    	));
        if ( empty( $events ) ) {
    		echo 'Sorry, nothing found.';
    	}
    	else foreach( $events as $post ) {
    		setup_postdata( $post );
    		echo get_the_title($post).', '.tribe_get_start_date().', '.tribe_get_city().', '.tribe_get_state().', '.tribe_get_country(). PHP_EOL;
    		
    		foreach ( $items as $item ) {
        		foreach ( $item as $field ) {
        			echo $field;
        		}
    	    }
    	} 
    ?>
    #1215285
    Jeff
    Participant

    Actually, we just decided today we’re not going to be using tickets so I don’t need you to answer this question. Thanks

    #1215628
    Nico
    Member

    Hey Jeff,

    Thanks for reaching out to us and also for the heads-up on the issue “resolution”!

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Code to print out all events plus the tickets for each event all at once’ is closed to new replies.