Support

Home Forums Event Espresso Premium My events not showing all events for various people

My events not showing all events for various people

Posted: April 4, 2019 at 2:07 am


SupercarDriver

April 4, 2019 at 2:07 am

Getting feedback from members saying they cannot see all the events they are registered for, it seems to change every few days unsure if it’s related to how many events they are signed up for?


Josh

  • Support Staff

April 4, 2019 at 12:30 pm

May I ask do you know if they are logged in to the site each time when they register for an event? If you’re not sure, then is that an optional thing where they could register without logging in to the site before they register for an event?


SupercarDriver

April 5, 2019 at 12:50 am

Hi Josh, all members have to be logged in to see and register for events.


Tony

  • Support Staff

April 5, 2019 at 11:05 am

Hi there,

It shouldn’t be related to the number of events they are registered onto.

Which template are you using with my events?

Is it just the default [ESPRESSO_MY_EVENTS] shortcode?

If you go to Event Espresso -> Registration Form -> User Integration Settings

What is the ‘Always sync contact information with WP user profile?’ option set to?


SupercarDriver

April 6, 2019 at 2:43 am

Hi Tony
Yep, just using normal [ESPRESSO_MY_EVENTS] shortcode

‘Always sync contact information with WP user profile?’ is set to ‘Yes’

Speaking to one member they had a couple of registrations in there but not some other which I confirmed they had registered for. A few days later the event was showing but the others weren’t. Is there a limit to the number of events shown?


Tony

  • Support Staff

April 8, 2019 at 6:56 am

Speaking to one member they had a couple of registrations in there but not some other which I confirmed they had registered for.

Where they the primary registrant on those ‘missing’ events?

A few days later the event was showing but the others weren’t.

This is odd, I’m not sure why days would affect the output of My Events, any caching enabled?

Is there a limit to the number of events shown?

There’s a default per page limit of 100, with pagination at the bottom that will display each group of 100.

For example on one of my test sites, it shows I have registrations on 268 events, so I get 3 pages – https://monosnap.com/file/b83QFZcpsTgBf5s3yH8pLpQOeta1vv

I have a lot more registrations than 268 but as the default list is EVENT base you get a list of events and then within each event a list of registrations.

You can change that limit per page using the per_page attribute.

If your getting registrations from users not showing up in the my events section it likely means that somehow the registration isn’t linked to the users EE_Contact record.

However, that also doesn’t make sense if registrations the were missing one day show up on the next.

If you view a registration that does NOT show up in a users my event section, edit the contact for that registration (You can click THIS icon on the registration list).

From there do you see the ‘WordPress User Profile link shown here:

https://monosnap.com/file/LK0hMR5syWpSdxMkiSVtAGNglGebFY

If so, click that, does it go to the correct user account?


SupercarDriver

April 10, 2019 at 7:32 am

Hi Guys,
After further investigation, I have found the issue.

A user registers for an event and can see their registration in my events.
However, as soon as that event sells out it disappears from the ‘my events’ list.

This would explain why events were there one day then not the next.

Is this a setting that can be changed so people who have registered can see which events they have booked onto despite if it is sold out?


Tony

  • Support Staff

April 10, 2019 at 8:16 am

No, there’s no setting for it as those are included by default, however, in one of your older threads:

https://eventespresso.com/topic/how-to-hide-past-events-on-the-my-events-shortcode/

You’ve customized the output so it removes expired events and if you are using the code Josh provided HERE, that’s telling the template to skip any event with a status other than upcoming, which will include sold out events.

if ( $event->get_active_status() != 'DTU' ) { return; }

In English, “if the event does not have a status of ‘DTU’ (DateTime Upcoming), return nothing”.

Sold out events will have a status of ‘DTS’ so the above will skip the event.

To allow only upcoming and sold out events, try:

$allowed_statuses = array(
    EE_Datetime::upcoming,
    EE_Datetime::sold_out,
);
if (! in_array($event->get_active_status(), $allowed_statuses)) {
    return;
}

The EE_Datetime::upcoming and EE_Datetime::sold_out pulls whatever value we use for upcoming and sold_out so in the future if we ever change those (although unlikely), the above should continue to work.


SupercarDriver

April 10, 2019 at 8:44 am

Hi Tony,

the code you gave originally worked but we also wanted to order the events by upcoming date so Josh provided this code:

<?php 
foreach ($objects as $object) :
    $object->start = '';
    if (! $object instanceof EE_Event) {
        continue;
    }
    $datetimes = array();
    $datetime = EEM_Datetime::instance()->get_primary_datetime_for_event( 
        $object->ID(), 
        true, 
        false
    );
    if(! $datetime instanceof EE_Datetime) {
        continue;
    }
    $object->start = $datetime->get_raw('DTT_EVT_start');
endforeach;
usort($objects, function($a, $b) {
    return strcmp($a->start, $b->start);
}); 
?>

So this bit of code: if ( $event->get_active_status() != 'DTU' ) { return; } doesn’t appear in the template I have.

Could the new code you have provided above work into this?


Tony

  • Support Staff

April 10, 2019 at 8:54 am

That code above would have gone into loop-espresso_my_events-event_section.template.php.

The code I’ve suggest above, would replace the code in content-espresso_my_events-event_section.template.php.


SupercarDriver

April 10, 2019 at 9:09 am

Of course, sorry been a while since I made the changes, I have changed and all seems to be working as it should, thanks again.


SupercarDriver

April 10, 2019 at 9:40 am

Hi, me again, it’s now showing past events again.

I removed if ( $event->get_active_status() != 'DTU' ) { return; }
or does that need to stay in as well as the new code?


Tony

  • Support Staff

April 11, 2019 at 6:02 am

That’s not happening on my text site that I’m using the same code on.

$allowed_statuses = array(
    EE_Datetime::upcoming,
);
if (! in_array($event->get_active_status(), $allowed_statuses)) {
    return;
}

Is the equivalent of if ( $event->get_active_status() != 'DTU' ) { return; } just done using in_array() to allow you to set more than one status without multiple || conditions.

So you don’t need both, my code replaces what you had with the same functionality + a sold out check. Adding both EE_Datetime::upcoming and EE_Datetime::sold_out means that it checks for DTU and DTS, if the event status does not equal either of those it returns nothing.

Can you zip up you template files and host them somewhere, then post a link to the templates so I can view them, please?

The support post ‘My events not showing all events for various people’ 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