Support

Home Forums Event Espresso Premium Events Table – hide disabled and sold out events

Events Table – hide disabled and sold out events

Posted: August 16, 2016 at 5:00 am

Viewing 3 reply threads


Waz

August 16, 2016 at 5:00 am

Hi Guys

I wish to hide events in the event table that are expired and sold out.

I see Josh posted this up to filter expired.
https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/de_ee_filter_events_out_with_expired_tickets.php

and I saw in another post (I can’t find it now) where someone gave the original code to filter sold out events.

I wish to hide all events that are expired and sold out. I know that I am meant to edit this line. Are you able to let me know how I go about working this out?

$SQL .= ' AND Ticket.TKT_end_date > "' . current_time( 'mysql', true ) . '" AND Ticket.TKT_deleted=0';

Thanks
Waz


Josh

  • Support Staff

August 19, 2016 at 2:44 pm

Hi Waz,

You shouldn’t need to edit that line. Instead, you can add an additional line of code. So right after the line that does the comparison on the Ticket sale end date, you add this code that does an extra comparison on the amount of tickets available:

$SQL .= ' AND Ticket.TKT_sold < Ticket.TKT_qty';


Waz

August 20, 2016 at 1:47 am

Hi Josh

Thanks for your help. I had a try of inserting that line as per following github code but it appears not to work. The test sold out event is still displaying. Any ideas on what could be going on?

https://github.com/VonNostrand/ee-code-snippet-library/blob/254a0108e81b57d43efa4fe012f4228ce64fdfac/templates/de_ee_filter_events_out_with_expired_tickets.php


Josh

  • Support Staff

August 22, 2016 at 6:42 am

Can you check what’s set for the Ticket QTY for the event?

Viewing 3 reply threads

The support post ‘Events Table – hide disabled and sold out events’ 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.

Event Espresso