Support

Home Forums Seating Chart Add-on (EE3) Adding the section to [LISTATTENDEES]

Adding the section to [LISTATTENDEES]

Posted: February 8, 2015 at 2:51 pm

Viewing 16 reply threads


Dovid Altein

February 8, 2015 at 2:51 pm

Hi there, how can i display the section of the guest when using the [LISTATTENDEES] shortcode?

I want people to be able to see which section their friends are seating so they can choose a seat.

Thanks


Dean

February 9, 2015 at 4:56 am

Hi,

You would have to edit the /wp-content/plugins/event-espresso/templates/attendee_list.php file (it can be copied to uploads/espresso/templates and edited there).

What I would do is this:

$seat = explode(' | ', $attendee->price_option);

Then you can echo $seat [0] wherever you want the seat to be displayed.

The only issue with this is that if an event doesn’t use seating, then it will just display the ticket name, so you may want an IF check to see if the string ($seat[0]) starts with Row, which all seat ID’s do.


Dovid Altein

February 9, 2015 at 8:19 am

This pulls in the ‘price_option’, how can i modify it to show the sections?
Also, any way to sort by section not by last name?

see http://events6.creativesls.com/attendees/

Thanks


Dovid Altein

February 10, 2015 at 8:18 am

any update in this?

Thanks


Tony

  • Support Staff

February 11, 2015 at 5:55 am

Hi Dovid,

The ‘section’ is not saved with the attendee info when a user registers onto the event, it is used within the seating chart as a representation. The seats ‘Custom Tag’ is saved with the registration and is what is being pulled by Deans code above.

What you can do is include an abbreviation of the section within the seats ‘Custom Tag’, like this – http://take.ms/ulf73

However this would need to be done before users booked onto the seat as updating the seating chart after a registration has been made will not update the registrations in EE3.


Dovid Altein

February 11, 2015 at 7:55 am

It seems like the section is more then just a representation on the seating chart as it can be pulled into the ticket email and ticket print page using the seatingchart_tag.
see https://eventespresso.com/topic/seating_tag-on-ticket-page/

Adding it to the custom tag will make a mess on the chart itself. also, I already have a few hundred people registered for this event…..

Thanks


Tony

  • Support Staff

February 11, 2015 at 3:13 pm

Hmm, ok, I see…

In that case you can use almost the exact same query within the attendee table and pull in the information you need.

Something like this – https://gist.github.com/Pebblo/efd134829ac8be1443b3

Would pull in the information needed.

You now have 4 new variables within the template:

$seatingchart_tag = '';
$seatingchart_seat = '';
$seatingchart_row = '';
$seatingchart_section = '';

As you can see these are set to empty strings before checking the seating chart info, this allows you to use those variables even if the attendee is not using the seating chart.


Dovid Altein

February 11, 2015 at 9:03 pm

I pasted the github code in the attendee_list.php file but the page turns up blank.
Am i missing something?

Please advise
Thanks


Tony

  • Support Staff

February 12, 2015 at 7:12 am

I’m using that same code locally without any issues, so I’m not sure why you are getting a white screen.

If you enable WP_Debug is there an error thrown?

Here is a copy of my attende_list.php template file – http://take.ms/liQkc

You will need to edit line 109 to include the seating variables you would like to use.


Dovid Altein

February 12, 2015 at 7:55 am

what syntax would I use on line 109 to add the seat and section?

Thanks


Tony

  • Support Staff

February 12, 2015 at 10:41 am

On that line, towards the end, you’ll see something like this:


You can use any of the found variables mentioned above joining them together with a period (.) and any spacer you may chose like a pipe ‘|’

So for example, to output “first name lastname – seat | section” you could use:


I have updated the gist with the code used above.


Dovid Altein

February 12, 2015 at 10:46 am

still getting a blank page.
see https://events6.creativesls.com/attendees/


Dovid Altein

February 12, 2015 at 11:01 am

got it working by rempving the php tags from the classes.

Now, how can I have it sorted by section?

Thanks


Tony

  • Support Staff

February 12, 2015 at 11:22 am

Removing the php tags from the classes?

When I view the page I see all the attendees, but non of the CSS or JS files are loading because the page is set to HTTPS – http://take.ms/51Gml

Sorting by section would require either a completely new query that includes the attendee data and the seating chart into in one, or using jQuery to order the results as they are now.

This would require custom development which is outside the scope of the support license.

You may be better contacting one of our recommends developers here:

https://eventespresso.com/developers/event-espresso-pros/


Dovid Altein

February 12, 2015 at 11:31 am

I took off the ssl and it load nicely.
Thanks for all the help on this issue.

2 more questions regarding the sections,

1. Anyway to add the section to be displayed in the admin attendee report screen (I guess by adding a column)?

2. How can I have the section on its own column for exports?
now I have it so it pulls everything in 1 column with the code below.

//Build the seating assignment
$seatingchart_tag = ”;
if (defined(“ESPRESSO_SEATING_CHART”)) {
if (class_exists(“seating_chart”)) {
if (seating_chart::check_event_has_seating_chart($event_id)) {
$rs = $wpdb->get_row(“select scs.* from ” . EVENTS_SEATING_CHART_EVENT_SEAT_TABLE . ” sces inner join ” . EVENTS_SEATING_CHART_SEAT_TABLE . ” scs on sces.seat_id = scs.id where sces.attendee_id = ” . $participant->att_id);
if ($rs !== NULL) {
$participant->seatingchart_tag = $rs->custom_tag . ” ” . $rs->section . ” ” . $rs->seat . ” ” . $rs->row;
}
}
}
} else {
$participant->seatingchart_tag = ”;
}


Dovid Altein

February 12, 2015 at 11:32 am

that’s in export.php line 485


Tony

  • Support Staff

February 13, 2015 at 11:43 am

These kind of customisations are not covered by our support, if this a critical requirement I would advise contacting one of our recommended developers here:

https://eventespresso.com/developers/event-espresso-pros/

To point you in the right direction for question 2, you can re-purpose the current row to display the section by changing the code from this:

$participant->seatingchart_tag = $rs->custom_tag . " " . $rs->seat . " " . $rs->row;

To this:

$participant->seatingchart_tag = $rs->section;
Viewing 16 reply threads

The support post ‘Adding the section to [LISTATTENDEES]’ 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