Home › Forums › Ticket Products › Event Tickets Plus › Additional Columns in the Attendees list CSV export
- This topic has 6 replies, 3 voices, and was last updated 7 years, 6 months ago by robert.
-
AuthorPosts
-
October 10, 2016 at 4:55 am #1174445robertParticipant
Hey folks,
This is the same question as found here:
https://theeventscalendar.com/support/forums/topic/additional-columns-in-the-attendees-list-csv-export/At the end of the discussion, Leah mentions that this is now possible as of version 4.1.
Could you point me in the right direction on how to work out how to do this?
Thanks,
JackOctober 11, 2016 at 8:41 am #1174909NicoMemberHey Jack,
Thanks for getting in touch with us! I’ll help you here ๐
Hopefully this is possible now! Can you please let me know which data are you trying to get into the export? It will also help to know which e-commerce plugin you are using alongside Event Tickets Plus.
Please let me know about it,
Best,
NicoOctober 12, 2016 at 7:15 am #1175351robertParticipantHey Nico,
Ideally I would like get all the user meta for the ticket holders. WooCommerce is our go-to Ecommerce plugin.
Many thanks,
JackOctober 14, 2016 at 12:42 pm #1176782NicoMemberThanks for following up Jack!
I just made a sample snippet for you to build on top. Just paste it in your theme’s (or child theme’s) functions.php file:
/* Tribe, adding user meta to the attendees csv export */
function tribe_export_custom_set_up ( $event_id ) {//Add Handler for Community Tickets to Prevent Notices in Exports
if ( ! is_admin() ) {
$screen_base = 'tribe_events_page_tickets-attendees';
} else {
$screen = get_current_screen();
$screen_base = $screen->base;
}
$filter_name = "manage_{$screen_base}_columns";add_filter( $filter_name, 'tribe_export_custom_add_columns', 100 );
add_filter( 'tribe_events_tickets_attendees_table_column', 'tribe_export_custom_populate_columns', 10, 3 );
}
add_action( 'tribe_events_tickets_generate_filtered_attendees_list', 'tribe_export_custom_set_up' );function tribe_export_custom_add_columns ( $columns ) {
$columns['user_nicename'] = "Nicename";
return $columns;
}function tribe_export_custom_populate_columns ( $value, $item, $column ) {
if ( isset( $item['user_id'] ) && (int)$item['user_id'] > 0 ) {
if ( 'user_nicename' == $column ) {
$user_info = get_userdata((int)$item['user_id']);$value = $user_info->user_nicename;
}} else {
$value = '-';
}return $value;
}
That should help you getting started!
Please let me know if this helps,
Best,
NicoOctober 18, 2016 at 3:53 am #1178200robertParticipantYo Nico,
You da man!
Was able to follow your code and hook this up with all the extra user meta we collect.
Much obliged.
JackOctober 18, 2016 at 6:27 am #1178234NicoMemberWooot! Stocked to hear you could work things out from my sample Jack ๐
Iโll go ahead and close out this thread, but if you need help with anything else please donโt hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
AuthorPosts
- The topic ‘Additional Columns in the Attendees list CSV export’ is closed to new replies.