Support

Home Forums Event Espresso Premium Exclude Canceled Registrations from ESPRESSO_MY_EVENTS display, or…

Exclude Canceled Registrations from ESPRESSO_MY_EVENTS display, or…

Posted: May 30, 2018 at 4:54 pm

Viewing 3 reply threads


mdeyerinkc

May 30, 2018 at 4:54 pm

Hi,

I’d like to know if there’s a way to exclude events for which a person registered and then subsequently canceled from the ESPRESSO_MY_EVENTS list that doesn’t require deleting those canceled registrations (as per this suggestion: https://eventespresso.com/topic/how-to-exclude-cancelleddeclined-tickets-in-espresso_my_events-shortcode/).

We would like to retain canceled registrations for tracking purposes, but yet we don’t want them to show up on a user’s “registered events” page if the status is approved.

Alternatively, is there a way to add a “status” column to the output show it shows the status of the registration? This would be less preferred, since the status will predominantly be “approved” and it will take up additional space; but it would be an acceptable alternative.


Josh

  • Support Staff

May 31, 2018 at 8:43 am

Hi,

There is a way and involves adding a bit of custom PHP code to some custom templates. Here’s how:
1) Set the shortcode on the page to use the “simple_list” template:
[ESPRESSO_MY_EVENTS template=simple_list_table]
2) Copy the loop-espresso_my_events-simple_list_table.template.php file from the WP User Integration add-on’s templates folder. You’ll upload the copy into your WordPress theme. See this guide on how to set up a child theme (recommended) https://codex.wordpress.org/Child_Themes
3) Open the copy in a code editor and immediately after this:

if ( ! $object instanceof EE_Registration ) {
	continue;
}

add this:

if ( $object->status_ID() == 'RCN') { 
	continue; 
}

Then save the file.


mdeyerinkc

May 31, 2018 at 10:51 am

That does the trick! Thanks Josh.

Quick question though… by placing the loop.template.php file in the child theme folder, I am essentially superseding the original file, correct? And if that’s true, then if the original file is ever changed through a future update, there is the potential for a conflict, since the superseding file would still be in effect (and the rest of the EE system relying on the updates to the original file might break without those updates). I don’t know how likely it is that the original file will be altered at some point, but it seems conceivable. If so, is there a “best practice” for a non-programmer like myself to keep tabs on those potential future conflicts?


Josh

  • Support Staff

May 31, 2018 at 11:52 am

The rest of the Event Espresso system does not rely on that template, but if there’s ever an update to that file (where for example a new feature is added), you’ll do well to merge those changes into your copy. Or make another copy of the updated template and re-add your customization.

Viewing 3 reply threads

The support post ‘Exclude Canceled Registrations from ESPRESSO_MY_EVENTS display, or…’ 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