Advertisement
eventsmanager

Custom Booking Summary Field - Ticket List

Apr 5th, 2022 (edited)
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2. /*
  3. * paste in your theme functions.php
  4. * after adding in your functions.php, go to Events > Bookings > Recent Bookings or by clicking an specific
  5. * click on the Gear icon and drag&drop field "Ticket List"
  6. */
  7.  
  8. function my_em_bookings_table_cols_template_attendee2($template, $EM_Bookings_Table){
  9. $template['ticket_list'] = 'Ticket List';
  10. return $template;
  11. }
  12. add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_attendee2',10,2);
  13.  
  14. function my_em_custom_booking_form_cols_attendee_list($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
  15. if( $col == 'ticket_list' ){
  16. $EM_Tickets_Bookings = $EM_Booking->get_tickets_bookings();
  17. foreach( $EM_Tickets_Bookings->tickets_bookings as $EM_Ticket_Booking ){
  18. $val .= "Ticket name: ".$EM_Ticket_Booking->get_ticket()->ticket_name. ' - Booked Space: ' . $EM_Ticket_Booking->ticket_booking_spaces ."<br>";
  19. }
  20. }
  21. return $val;
  22. }
  23. add_filter('em_bookings_table_rows_col','my_em_custom_booking_form_cols_attendee_list', 10, 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement