I am looking for a way to get all of the ticket ID’s for an event within the Single event template. We use the LearnDash addon and looking to only show tickets for a user if they have the prerequisite course completed. We believe we can do this, but need a way to get all the ticket IDs so we can then subsequently grab the course Ids from the ticket.
Is there a method for retrieving the tickets for the current event or a specific event ID?
Yes, you can use our model system to grab those details fairly easily. If you are going to do any custom dev work for Event Espresso I highly recommend taking a look at the Model System docs here:
The above isn’t the most efficient method as all you want is the ID’s and you’ll get EE_Ticket objects, but it’s easily readable.
If you don’t have the EE_Event object, you can use $event = EEH_Event_View::get_event(); from within the single event output and EE will do its best to pull that object in for you without the ID.
The support post ‘Get All Ticket Id's for an Event’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.