Additional Columns in the Attendees list CSV export

Home Forums Ticket Products Event Tickets Plus Additional Columns in the Attendees list CSV export

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1174445
    robert
    Participant

    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,
    Jack

    #1174909
    Nico
    Member

    Hey 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,
    Nico

    #1175351
    robert
    Participant

    Hey Nico,

    Ideally I would like get all the user meta for the ticket holders. WooCommerce is our go-to Ecommerce plugin.

    Many thanks,
    Jack

    #1176782
    Nico
    Member

    Thanks 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,
    Nico

    #1178200
    robert
    Participant

    Yo Nico,

    You da man!

    Was able to follow your code and hook this up with all the extra user meta we collect.

    Much obliged.
    Jack

    #1178234
    Nico
    Member

    Wooot! 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Additional Columns in the Attendees list CSV export’ is closed to new replies.