Support

Home Forums Event Espresso Premium Primary Registrant – wrong names Reply To: Primary Registrant – wrong names

Reply To: Primary Registrant – wrong names

Author Replies
Allen # Posted on March 5, 2018 at 5:33 pm

by custom templates, do you mean the content-espresso_event_attendees.php file?

I tried adding your parameter to one of the pages – didn’t fix the issue.

<?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(
            '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; ' 
    . '<span style="color:#C0C0C0;">'
    . $contact->city()
    . $state 
    . '</span>'
    . '</li>';
    
  }
}
    
do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar );

Thats what I have on the custom page. Not sure what else you’re alluding to.

So why do pending and cancelled registrations show up?

Do NOT follow this link or you will be banned from the site!