Support

Home Forums Event Espresso Premium HIde "sold out" events in EE3

HIde "sold out" events in EE3

Posted: October 3, 2017 at 12:01 pm


Melody Jewitt

October 3, 2017 at 12:01 pm

Hi there, I am using EE 3.1.35.1.P and have modified the custom “Events Table” template to display a list of events filtered by category. This is working well, however it is showing events that are sold out. Is there a way to filter out events that are full with this version of EE?

It’s possible that the version I’m on isn’t able to do this as I noticed in the code there is a comment about needing version 3.1.37 to enable the filter_hook_espresso_get_num_available_spaces hook. Would upgrading to 3.1.37 help?

FYI I found this answer on the forum – it looks like this is possible in EE4 using the general settings but upgrading isn’t an option at this point. https://eventespresso.com/topic/sold-out-past-events-how-do-you-hide-them/


Josh

  • Support Staff

October 4, 2017 at 8:52 am

Hi Melody,

Yes this is likely possible by making more edits to your modified template. May I ask what is the file name of the template that’s modified? The reason I ask is because there is more than one table template for EE3. Also, it will be best if you can update your site to the current version of EE3 because you’ll have a more reliable codebase to work with, and your site will have the security fixes that were added since 3.1.35.


Melody Jewitt

October 11, 2017 at 10:11 am

Hi Josh, thanks for your reply. To answer your question the file name of the template that’s modified is “plugins/custom-templates/templates/events-table/template.php”

Does that help?


Melody Jewitt

October 11, 2017 at 10:12 am

Here’s my code:

redacted – Event Espresso support team – LOC


Josh

  • Support Staff

October 11, 2017 at 10:14 am

Can you post the code to a pastebin or gist? The support forums aren’t intended to be used for development help, but if you can post the code in a pastebin or gist, then link here, we can take a look at the code and we’ll go from there.


Melody Jewitt

October 16, 2017 at 10:36 am

Sure, here ya go

https://pastebin.com/iiTtVZv0


Josh

  • Support Staff

October 17, 2017 at 2:56 pm

OK thank you.

On line 49 you have this:

if($open_spots < 1 && $event->allow_overflow == ‘N’) {

After that line of code you can add:
continue;

and that will remove sold out events from the display.


Melody Jewitt

October 17, 2017 at 7:10 pm

That worked perfectly! Thank you Josh!

The support post ‘HIde "sold out" events in EE3’ 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