Hello! I have events with tickets set to go on sale at a future date. Currently the table template lists these events the same as other dates, and the guest has to click through to the event detail page before seeing that tickets go on sale in the future. Is there a way to mod the table template so that I can class all events with future ticket sale dates and hide them with CSS? Thanks!
You can copy the table template into your themes root directory and make any changes you prefer there (preferably using a child theme if you are not using your own custom theme).
So you would copy \wp-content\plugins\eea-events-table-template\templates\espresso-events-table-template.template.php
Into your themes root directory, and then you could do something like:
if( !$event->tickets_on_sale() ) {
//The event currently does not have any tickets on sale (based on the sale starts/ends dates of tickets)
//Check if there are any upcoming tickets on the event.
$upcoming_ticket = $event->tickets(
array(
array(
'TKT_start_date' => array('>=', \EEM_Ticket::instance()->current_time_for_query('TKT_start_date')),
'TKT_deleted' => false,
),
'limit' => 1
)
);
if( !empty($upcoming_ticket) ) {
//We have an upcoming ticket.
//Set an event class for upcoming tickets here.
} else {
//The event currently does not have active tickets, nor any upcoming.
//Set an event class for no tickets here
}
}
Maybe set a variable within the two conditionals and echo that in the table, its up to you.
The support post ‘EE4 – Hide upcoming events on table template’ 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.