Support

Home Forums Event Espresso Premium Wait List Front End shows one name (but 50+ are on it)

Wait List Front End shows one name (but 50+ are on it)

Posted: March 13, 2022 at 12:02 pm

Viewing 4 reply threads


Allen

March 13, 2022 at 12:02 pm

I’ve had issues getting my Wait List to render on the front end of site. Ive used code you provided, but some reason doesn’t work. You’ve tried to help me before – it has something to do with some code I customized years ago.

The code you gave me is:
[ESPRESSO_EVENT_ATTENDEES event_id=12074 status=RWL]

However, for some odd reason – the code is now showing one name. There are more than 50 people on the Wait List. I can’t figure out why it is showing just one name.

You can see the list on the page: https://superbilliardsexpo.com/events/womens-2022/

Just scroll down to bottom of page

Can you offer any insight?

I’d REALLY like this code to display all names on Wait List, in chronological order … and would pay to have one of you code this for me. I don’t know how to do so.


Tony

  • Support Staff

March 15, 2022 at 7:20 am

Hi Allen,

You’ve tried to help me before – it has something to do with some code I customized years ago.

IIRC you have an espresso attendees template in the root directory of your theme, correct?

If you can share the code in use within that here I can take a look and see if something stands out to fix the issue.

If it’s not something obvious there I can take a deeper look into this if you’d like to purchase a support token.


Allen

March 15, 2022 at 11:49 am

I have a “content-espresso_event_attendees.pho” file that looks like this:

<?php
/**
 * Content Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
 *
 * @package Event Espresso
 * @subpackage templates
 * @since 4.6.29
 * @author Darren Ethier
 *
 * Template Args that are available in this template
 * @type EE_Attendee $contact
 * @type bool       $show_gravatar  whether to show gravatar or not.
 */

if ( $show_gravatar ) {
	$gravatar = get_avatar( $contact->email(),
		(int) apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__avatar_size', 32 )
		);
} else {
	$gravatar = '';
}

$states = EEM_State::instance()->get_all_states();
$state = isset( $states[ $contact->state_ID() ] ) ? $states[ $contact->state_ID() ]->get( 'STA_name' ) : $contact->state_ID();
$state = ! is_numeric( $state ) ? ', ' . $state : '';
$countries = EEM_Country::instance()->get_all_countries();
$country = isset( $countries[ $contact->country_ID() ] ) ? $countries[ $contact->country_ID() ]->get( 'CNT_name' ) : $contact->country_ID();
$country = ! empty( $country ) ? ', ' . $country : '';

$registrations = array();
if ($contact instanceof EE_Attendee) {
    $registrations = EEM_Registration::instance()->get_all(array(
array(
'STS_ID' => 'RAP',
'ATT_ID' => $contact->ID(),
'EVT_ID' => $event->ID()
),
));
}

foreach($registrations as $registration ){
  if($registration instanceof EE_Registration){
    echo '<li>' . $gravatar . '&nbsp;' .  $contact->full_name() . ' ' 
    . '&ndash; &nbsp;' 
    . '<span style="color:#4D4B4B; font-size:.85em;">'
    . $contact->city()
    . $state
    . '</span>'
    . '</li>';
    
  }
}
    
do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar );

And I have a “loop-espresso_event_attendees.php” code that looks like this:

<?php
/**
 * Loop Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
 *
 * @package Event Espresso
 * @subpackage templates
 * @since 4.6.29
 * @author Darren Ethier
 *
 * Template Args that are available in this template (yarr!)
 * @type EE_Attendee[] $contacts
 * @type EE_Event   $event
 * @type EE_Datetime|null  $datetime  an EE_Datetime object will be available if the the datetime_id attribute is set in the shortcode and the id matches a valid datetime.
 * @type EE_Ticket|null  $ticket  an EE_Ticket object will be available if the the ticket_id attribute is set in the shortcode and the id matches a valid ticket.
 * @type bool       $show_gravatar  whether to show gravatar or not.
 */

$no_attendees_message =  apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message', __('No Attendees Yet', 'event_espresso' ) );

?>

<div class="event-attendees">
    <?php do_action_ref_array(
        'AHEE__loop-espresso_event_attendees__before',
        array(
            $contacts,
            $event,
            $datetime,
            $ticket,
            $show_gravatar,
        )
    ); ?>
	<?php if ( $contacts ) : ?>
		<ol class="event-attendees-list">
			<?php foreach( $contacts as $contact ) :
				EEH_Template::get_template_part( 'content', 'espresso_event_attendees', array( 
					'contact'       => $contact, 
					'event'         => $event,
					'datetime'      => $datetime,
					'ticket'        => $ticket,
					'show_gravatar' => $show_gravatar 
				) );
				endforeach; ?>
		</ol>
	<?php else : ?>
		<p><?php echo $no_attendees_message; ?></p>
	<?php endif; ?>
    <?php do_action_ref_array(
        'AHEE__loop-espresso_event_attendees__after',
        array(
            $contacts,
            $event,
            $datetime,
            $ticket,
            $show_gravatar,
        )
    ); ?>
</div>

——-

Still very baffled why only one name is showing up on the list?

https://superbilliardsexpo.com/events/womens-2022/

There are over 50 names in the backend on this list.


Tony

  • Support Staff

March 16, 2022 at 5:59 am

Still very baffled why only one name is showing up on the list?

Ok, so I can answer that.

ESPRESSO_EVENT_ATTENDEES lists the ‘Contacts’ on an event, so let’s say I purchased 3 tickets, that’s 3 registrations on the event. If we simply listed all registrations my name (along with anyone else’s who bought multiple tickets) would be listed 3 times in that example.

So rather than do that, we list all of the ‘contacts’ linked to registrations on the event. Meaning no matter how many registrations ‘Tony Warwick’ has on your event, I’m listed once, because all of those registrations are still for ‘me’, right? The fact that I have 3 registrations doesn’t make 3 of ‘me’, I’m still the attendee.

What your custom templates are trying to do is list ALL of the registrations linked to a contact but then only the ones that have a status of ‘Approved’.

So to explain that a little in your set-up…

[ESPRESSO_EVENT_ATTENDEES event_id=12074 status=RWL]

Tells Event Espresso to pull in all of the contacts linked to registrations with a status of RWL (waitlist). That happens a little in loop-espresso_event_attendees.php (sorta, it actually happens before that when the shortcode is processed), which sets up the contacts and then uses content-espresso_event_attendees.php for each one to output details.

content-espresso_event_attendees.php is then looping over the contacts and only pulling in registrations for the contact if they have a status of Approved, but that contradicts what you are trying to do, right?

So the reason only 1 person shows up (as far as I can tell) is that Maria also has a registration that has a status of Approved:

https://monosnap.com/file/tl201rB1J2ST796i8pedrMkH5FCRQm

Because EE pulled in all of the waitlist registrations and then the custom template looped over each of those only pulling in Approved registrations to display.

With the current setup you can’t have both options.

Temporarily rename content-espresso_event_attendees.php to something else to disable it, such as content-espresso_event_attendees_temp.php

Then load the event again, does it show the registrations you are expecting then? (The output will likely be ‘wrong’ and not have the details you want, but are the registrations being displayed then correct?)


Allen

March 22, 2022 at 10:44 am

OK, yes, when I change the file name the Wait List shows. But, the list of actual attendees then only displays 154 names – when there are 157 approved.

I don’t recall why (or how) I changed the code many years ago. Im not a programmer, obviously. But, I need it to work the way it is now, and for the Wait List to display also…

Can this be done? Even if we need to pay for it, I’m okay with that.

I’d like the “Registered Players” list to show exactly how it does (with city/state next to name and in alphabetical order) and for the Wait List to display chronologically … (number 1 on list is first to get promoted, etc)

Viewing 4 reply threads

The support post ‘Wait List Front End shows one name (but 50+ are on it)’ 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