Attendee CSV Export missing phone and address details

Home Forums Ticket Products Event Tickets Plus Attendee CSV Export missing phone and address details

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1291372
    Chris
    Participant

    I can’t seem to find where I can get ALL the attendees details in the export. It is talked about 3 years ago here – https://theeventscalendar.com/support/forums/topic/additional-columns-in-the-attendees-list-csv-export/ and here – https://theeventscalendar.com/support/forums/topic/attendees-export-csv-more-user-info-columns/ but you still don’t get BASIC stuff like address and phone number. Perhaps I am missing something and you can point me in the direction of setting it up. Thanks.

    #1292581
    Shelby
    Participant

    Hi there Chris,

    I’m happy to help out with this. πŸ™‚

    I think you may find this free extension helpful forΒ your particular issue. If I’ve misunderstood, feel free to clarify, and we can work on your request together. πŸ™‚

    Best,

    Shelby πŸ™‚

    #1293598
    Chris
    Participant

    Thanks for that Shelby but have already done that via the functions.php.

    I am looking for the phone and address to be added to the CSV export.

    #1293999
    Shelby
    Participant

    Hey Chris,

    Thanks for clarifying!

    Unfortunately, this kind of request isn’t a built in option, and would require some customization that we can’t provide on these forums. However, we do have some resources for guiding you in doing that here. If you need to find someone to help with the customizations, we also have some tips for finding help here.

    Hope this helps!

    Thanks,

    Shelby πŸ™‚

    #1295542
    Bruce
    Participant

    Hey Chris,

    I ran into the same problem, but found a solution. Add the following to your themes functions.php and you can add the phone and address details to the CSV.

    I found this hook in https://theeventscalendar.com/support/forums/topic/export-out-attendees-list/

    /**
     * Adds extra columns to the attendee export data (CSV only).
     *
     * Filters via the tribe_events_tickets_attendees_csv_items hook; intended for use
     * with the initial 4.1 release of Event Tickets only.
     *
     * @param  array $items
     * @return array
     */
    function attendee_export_add_purchaser_email_name( $items ) {
        $count = 0;
        $order_id_col = 0;
        $idx = 0;
    
        foreach($items[0] as $col_name) {
          if (strtolower($col_name) == "order id") {
            $order_id_col = $idx;
            break;    
          }
          $idx++;
        }
    
        foreach ( $items as &$attendee_record ) {
    
            // Add the header columns
            if ( 1 === ++$count ) {
                $attendee_record[] = 'Customer Phone';
                $attendee_record[] = 'Address 1';
                $attendee_record[] = 'Address 2';
                $attendee_record[] = 'City/Town';
                $attendee_record[] = 'State';
                $attendee_record[] = 'Post Code';
            }
            // Populate the new column in each subsequent row
            else {
                // Assumes that the order ID lives in the first column
                $order = wc_get_order( (int) $attendee_record[$order_id_col] );
                $attendee_record[] = $order->billing_phone;
                if (strlen(trim($order->shipping_address_1)) > 0) {
                  $attendee_record[] = $order->shipping_address_1;
                  $attendee_record[] = $order->shipping_address_2;
                  $attendee_record[] = $order->shipping_city;
                  $attendee_record[] = $order->shipping_state;
                  $attendee_record[] = $order->shipping_postcode;
                } else {
                  $attendee_record[] = $order->billing_address_1;
                  $attendee_record[] = $order->billing_address_2;
                  $attendee_record[] = $order->billing_city;
                  $attendee_record[] = $order->billing_state;
                  $attendee_record[] = $order->billing_postcode;
                }
            }
        }
     
        return $items;
    }
    add_filter( 'tribe_events_tickets_attendees_csv_items', 'attendee_export_add_purchaser_email_name' );
    #1297463
    Barry
    Member

    Thanks for sharing and highlighting that solution, Bruce!

    #1298973
    Chris
    Participant

    Hi Bruce,

    Thanks for that, just what we needed! Works perfectly.

    All the best
    Chris

    #1299291
    Shelby
    Participant

    Hi Chris,

    Glad to see this resolved! Please reach out in the future with any questions or concerns you have about our plugins! πŸ™‚

    Best,

    Shelby πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Attendee CSV Export missing phone and address details’ is closed to new replies.