Posted: May 11, 2020 at 7:32 am
hi, i’ve modified the espresso template called ‘attendee-list.php’ to include the email of the registered attendees to my list generated by the shortcode. i’d also like to add the ticket name. i tried the following code, but it’s not working. is there a way to do this? i’m using ee3.
//Please refer to this page for an updated lsit of shortcodes: https://eventespresso.com/forums/?p=592 /*Example CSS for your themes style sheet: li.attendee_details{ //The following code displays your list of attendees. //This variable is only available using the espresso_event_status function which is loacted in the Custom Files Addon (https://eventespresso.com/download/plugins-and-addons/custom-files-addon/) <div class="<?php espresso_template_css_class('event_display_boxes','event-display-boxes ui-widget'); ?>"> <h2 class="<?php espresso_template_css_class('event_title','event_title ui-widget-header ui-corner-top'); ?>"> <div class="<?php espresso_template_css_class('event_data_display','event-data-display ui-widget-content ui-corner-bottom'); ?>"> <?php //echo wpautop($event_desc); ?>
<?php $a_sql = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE . " WHERE event_id='" . $event_id . "'"; $a_sql .= $paid_only == 'true'? " AND (payment_status='Completed' OR payment_status='Pending' OR payment_status='Refund') ":''; $a_sql .= $sort; //echo $a_sql; $attendees = $wpdb->get_results($a_sql); foreach ($attendees as $attendee){ $id = $attendee->id; $lname = $attendee->lname; $fname = $attendee->fname; $city = $attendee->city; $state = $attendee->state; $country = $attendee->state; $email = $attendee->email; $ticket_name = $ticket_name->ticket_name; $gravatar = $show_gravatar == 'true'? get_avatar( $email, $size = '100', $default = 'http://www.gravatar.com/avatar/' ) : ''; $city_state = $city != '' || $state != '' ? '<br />' . ($city != '' ? $city :'') . ($state != '' ? ', ' . $state :' ') :''; //These are example variables to show answers to questions ?> <?php </div> |
|
sorry for the terrible code. can’t seem to find how to edit it. here it is in pastebin https://pastebin.com/TEvSKFFm |
|
Hi there, Replace With If you do something like |
|
hmm… i changed that line, but am still not doing something right because the page is just WSOD. i don’t understand what you mean about the var_dump? should i put that somewhere else in my code? |
|
When you get a WSOD your getting a fatal error, in this case likely a syntax error and you’d need to check the error logs to find it. In your case, the end line 92 is incorrect:
The Change it to:
Does it work then? |
|
thank you. i know just enough about php to break things. π i changed that and am now able to see the page, but the ticket name isn’t in my lists. |
|
This reply has been marked as private. | |
On line 94, just after That will output a bunch of data for each attended and possible break the layout for now but it’ll show what is missing. |
|
oh! i got it. π i had two versions open and had made one change in one, and another in the other and things were getting weirdly overwritten. thank you for walking me through this π |
|
Ahh, ok. I’ve done that before myself π Side note if I may, the output it currently a little hard to read, I’m guessing you’re already looking to change it but you can do something like this:
Which will wrap the ticket name in |
|
thank you, that does make it better on the eyes. |
|
You’re most welcome. Any further questions just let us know. |
|
The support post ‘how do i add ticket name to my shortcode output?’ 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.