Support

Home Forums Event Espresso Premium How do we stop an event from showing in the events list when it has started?

How do we stop an event from showing in the events list when it has started?

Posted: June 2, 2021 at 5:41 am

Viewing 11 reply threads


point6

June 2, 2021 at 5:41 am

How do we stop an event from showing in the events list when it has started?

We have this events page which is a customised page from our own theme:
https://www.mariamontessori.org/events/

We want to change this so that events are no longer shown once one (or any) of the datetime have started. Currently the client is marking the event as Sold Out but this prevents easy reporting and filtering on the WP back-end.

We can Mark an event as Sold Out once it starts (regardless the fact that is sold out or not): this does remove the even from the event page but makes it impossible to sort the events in reports as only some fields are available in the drop down menu (see screenshot below)

They also commented:

Just to clarify, if we, as you suggested, add all the course sessions to the course page, the course will show as UPCOMING until it is finished, so it will never show as ACTIVE in EE. Is that correct? Is that how it is supposed to work? how can we discriminate between real upcoming events and “active/current” events that are only marked as upcoming?

Any help would be much appreciated.

Thanks,


Tony

  • Support Staff

June 2, 2021 at 6:51 am

Hi there,

How do we stop an event from showing in the events list when it has started?

To remove those you’ll need to add a snippet to the site, this should do it:

https://gist.github.com/joshfeck/646d496e72942b5251d484d522d762ee

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Just to clarify, if we, as you suggested, add all the course sessions to the course page, the course will show as UPCOMING until it is finished, so it will never show as ACTIVE in EE. Is that correct? Is that how it is supposed to work? how can we discriminate between real upcoming events and “active/current” events that are only marked as upcoming?

Apologies but I’m not sure I follow, can you add some additional details on this?

An event with a DateTime that is happened now() will show as Active, if it then has a DateTime set on a later date then once the current DateTime has expired it should once again show upcoming.


point6

June 9, 2021 at 9:41 am

Hi

Thank you for the reply and sorry for the delay coming back to you – I was away on holiday last week.

To remove those you’ll need to add a snippet to the site, this should do it:

I have added this and asked the client to check.

Apologies but I’m not sure I follow, can you add some additional details on this?

I think this can be ignored if the above gist works. I will report back.

Thanks,


point6

June 11, 2021 at 8:48 am

Hi

I have another question from our client using EE.

We run a one ticket event training course that runs over several days/sessions. In the event we are adding all of these sessions as datetimes. The feedback from out client is the following:

If we, as you suggested, add all the course sessions to the course page, the course will show as UPCOMING until it is finished, so it will never show as ACTIVE in EE, and always be present in the Events page.

I’m not sure if the gist you sent will help us on this? Any advice would be appreciated.

Thanks,


Tony

  • Support Staff

June 11, 2021 at 11:30 am

Can you post an example event so I can view this?

When the current date/time is between the event datetime’s start/end date and time, the event should show as active, when that datetime passes, if there is another datetime in the future the event should again show as upcoming.


point6

June 15, 2021 at 2:01 am

Hi Tony,

Thank you for the reply. The events are changing every week but here is the current events: https://www.mariamontessori.org/events/

In this I don’t think we have an example to show you. I think what the client is asking for is when an event’s first datetime starts until the last, can it show as active instead of upcoming?


Tony

  • Support Staff

June 15, 2021 at 5:23 am

No, not currently but just clarify, is this within the admin?

An event will only show as active when it has an ‘active’ DateTime at the time of the request.

So, on that event you linked me to it will next show as ‘active’ on 19th June between 9:30am and 11:30am, after that it will again switch to ‘upcoming until’ 26th June 9:30-11:30am and then again switch to active etc.

I see you’re using the events as a collection of sessions and consider it ‘active’ from session 1 though to the final session, EE can’t be changed to consider an event active throughout all of the datetimes currently.

You could add an additional column to the events list table to give some indication of that using the hooks available within EE but its not something we have built in.


point6

June 28, 2021 at 5:05 am

Hi Tony,

Thanks for your help so far. I have spoken with the client and have something I would appreciate your thoughts on.

We currently run a course that runs over multiple dates and one ticket gets access to all of the dates so we are using Datetimes for each of the days.

This creates an issue where tickets are still available for sale even after it has started.
This also creates this issue where they switch from ACTIVE to UPCOMING as each of the Datetimes start and end.

We are planning on stopping using the Datetimes and only adding the dates as plain text as a custom field as we want ticket sales to stop when the event session starts and we want it to only show as ACTIVE during that period.

Does this sound doa-ble and are there any issues with doing it this way?

Thanks,


Tony

  • Support Staff

June 28, 2021 at 9:26 am

Tickets within Event Espresso require the use of a datetime, you can stop outputting them on the front end but internally the tickets will still need to be assigned to to datetime.

That means that everywhere else that is outputting dates will need some form of change (be it code or template changes) to stop EE from outputting the datetime values and use your custom field.

However, I’m still not sure I understand why the datetime showing active is an issue. If I can understand the problem better we may be able to help point you in the right direction to fix it.

This creates an issue where tickets are still available for sale even after it has started.

From the above it sounds like you want ticket sales to stop when the first session starts, is that correct?

Meaning you have say:

Course Ticket = $100

Datetime 1 = Monday 5th July
Datetime 2 = Monday 12th July
Datetime 3 = Monday 19th July
Datetime 4 = Monday 26th July

You want that ticket to only be available up until a specific date? After that closed? So say you want ticket sales for that course to stop when Datetime 1 starts, can you not just set the ‘Sell until’ date of the ticket to be Monday 5th July?

This also creates this issue where they switch from ACTIVE to UPCOMING as each of the Datetimes start and end.

I’m not sure I follow why this is an issue, I guess I’m missing something obvious with it but switching from Upcoming to Active during the times when a datetime is ‘active’ (meaning happening now) seems the most logic thing we can do with EE?


point6

July 6, 2021 at 5:44 am

Hi Tony

Thank you for the reply and sorry for the delay coming back. Our client runs training courses that run on several over several sessions. Buying a ticket gives you access to all sessions as it is part of the full course and you cannot buy a ticket for just one of those sessions.

1) They are adding the event and then each of the DateTimes for each of the sessions and want the event to no longer to appear once the FIRST session has started. They also don’t want tickets to be available once the first session has started and you have covered this off by using the ‘Sell until’ date.

2) The part around switching from ACTIVE to UPCOMING probably relates to their confusion as internally once the first session has started the entire course is active as far as they are concerned.

We want the events to no longer to appear on lists (like the events) page when they have started the first session.

Thank you again for your help.


point6

July 6, 2021 at 6:05 am

Sorry, one thing I missed off. We added the code in this Gist:
https://gist.github.com/joshfeck/646d496e72942b5251d484d522d762ee

But it is not working as expected – it looks like this prevents an event from showing dependant on its Datetime. Is it possible to change this to not show the event if no tickets are available using the ‘Sell Until’ value?

Thanks,


Tony

  • Support Staff

July 6, 2021 at 8:45 am

It sounds like that snippet is working as expected (removing the events based on the Datetime start date), but it’s not the right snippet for you and I think you need this:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/de_ee_filter_events_out_with_expired_tickets.php

If you are setting all of the tickets ‘sell until’ dates to match the first Datetime start date (or even a date before that) then the above will remove the event(s) once that date is reached.

WRT the Active/Upcoming status, changing out how the status works is going to be fairly involved. It’s likely possible (and we are open to adding additional hooks in the if need be), but will require you to hook into various places to set it up correctly.

For example, changing the event status column on the Event Espresso -> Events list table section to show how you are requesting is possible, you’ll need your own custom code to hook in and replace that column with a function that outputs the ‘correct’ status based on your requirements. However, if the end user then wants to filter ‘active’ events on that table, the query will use what EE expects as active and not your version of active, so you hook in there and alter the query (again possible to do) until they want to specifically pull those types of events to display on the font end, more custom code to work for those requirements and so on.

(It’s important to note here that because of the above we wouldn’t walk through changing this in every location needed as it’s basically a custom feature based on the datetimes of the event. I know you haven’t asked us to but just wanted to clarify so you have all of the information to make a decision from here)

What about adding an additional column to the event list table and using that to identify if the course has already started? For example, you could add an additional column that always pulls in the ‘first’ DateTime from the event and shows it as ‘Course start date’. You could also then change the current ‘Event Start’ column title to ‘Next Session Date’.

That would look something like this: https://monosnap.com/file/krfJurQwiSQljW4gFogW52jSKSE8qt

Viewing 11 reply threads

The support post ‘How do we stop an event from showing in the events list when it has started?’ 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