Hi there… I’m trying to do a loop through all my events in a category, then output the start date along with the Woocommerce product ID for the associated ticket. I’m using Events Calendar Pro with Events Tickets Plus. What I’ve got so far works, but I don’t know how to get the ticket product ID for a given event.
<?php
$events = tribe_get_events(array(
'tribe_events_cat' => 'restaurant'
));
$start_date = date_format(date_create(get_post_meta($event->ID, '_EventStartDate', true)),"l F j");
$product_id = '' //This should be the product ID of the ticket
if ( empty( $events ) ) {
echo '<option>No events found</option>';
}
else foreach( $events as $event ) {
echo '<option value="'.$product_id.'">'.$start_date.'</option>';
}
?>
Hope that makes sense! Let me know if you need more info to help out.