eventsmanager

attendee by ticket

Aug 5th, 2013
580
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * paste in your theme functions.php
  3. * after adding in your functions.php, go to Events > Bookings > Recent Bookings or by clicking an specific
  4. * click on the Gear icon and drag&drop field "Attendee By Ticket"
  5. */
  6.  
  7.  
  8. function my_em_bookings_table_cols_template_attendee($template, $EM_Bookings_Table){
  9. $template['attendee_by_ticket'] = 'Attendee By Ticket';
  10. return $template;
  11. }
  12. add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_attendee',10,2);
  13.  
  14.  
  15. function my_em_custom_booking_form_cols_attendee($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
  16. $EM_Tickets_Bookings = $EM_Booking->get_tickets_bookings();
  17. $attendee_datas = EM_Attendees_Form::get_booking_attendees($EM_Booking);
  18. $attendee_list = "";
  19. foreach( $EM_Tickets_Bookings->tickets_bookings as $EM_Ticket_Booking ){
  20. //Display ticket info
  21. if( !empty($attendee_datas[$EM_Ticket_Booking->ticket_id]) ){
  22. $attendee_list .= "<ul>";
  23. $attendee_list .= "<li> <strong>Ticket name: ".$EM_Ticket_Booking->get_ticket()->ticket_name."</strong></li>";
  24. foreach( $attendee_datas[$EM_Ticket_Booking->ticket_id] as $attendee_title => $attendee_data ){
  25. $attendee_list .= "<li>".$attendee_title."</li>";
  26. $attendee_list .= "<li><ul>";
  27. foreach( $attendee_data as $field_label => $field_value){
  28. $attendee_list .= "<li>". $field_label .': '.$field_value."</li>";
  29. }
  30. $attendee_list .= "</ul></li>";
  31. }
  32. $attendee_list .= "<ul>";
  33. }
  34. }
  35. return $attendee_list;
  36. }
  37. add_filter('em_bookings_table_rows_col','my_em_custom_booking_form_cols_attendee', 10, 5);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×