Including ticket type in bookings CSV export

WordPress Event Management, Calendars & Registration Forums General Question Including ticket type in bookings CSV export

This topic contains 2 replies, has 2 voices, and was last updated by  David McCourt 9 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18875

    Is it possible to modify the export function to include ticket types? My client is offering free bookings and has two types of tickets: main ticket and a reserve ticket.

    When exporting it is not possible to see which is which. Are there any filters for this?

    Many thanks

    David McCourt
    #18902

    Hi David,

    This information is included in the CSV export of tickets rather than bookings.

    If you wanted to include it in bookings, you could use the following snippet:

    add_filter( 'eventorganiser_export_bookings_headers', function( $columns ) {
        $columns['ticket_types'] = 'Ticket types';
        return $columns;
    } );
    
    add_filter( 'eventorganiser_export_bookings_cell_ticket_types', function( $cell, $booking, $export ) {
        $tickets = eo_get_booking_tickets( $item->ID, false );
        $cell    = '';
            if( $tickets ){
                $ticket_names = wp_list_pluck( $tickets, 'ticket_name' );
                $cell = implode( ', ', $ticket_names );
            }       
        return $cell;
    }, 10, 3 );
    
    Stephen Harris
    #18960

    Thanks Stephen. For anyone else following there is a small mistake in the above code:

    $tickets = eo_get_booking_tickets( $item->ID, false );
    

    Should be:

    $tickets = eo_get_booking_tickets( $booking->ID, false );
    
    David McCourt
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.