Payment Gateway on Ticket?

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 9 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21494

    When I download the bookings to csv, I see the payment gateway. When I download the tickets to csv, I do not.

    I have been using ‘Offline’ to be ‘pay-at-the-door’. Since those tickets will show ‘pending’, I do not know whether it is a PayPal ‘pending’ or an ‘Offline’ pending.

    Can I make a change to the ticket download to include the payment gateway?

    Greg MacKinnon
    #21508

    Hi Greg,

    You can do this as follows.

    First add a column to the CSV ticket export:

     add_filter( 'eventorganiser_export_tickets_headers', function( $columns ) {
          $columns['booking_gateway'] = 'Gateway';
          return $columns;
     } );
    

    and then provide a function to populate the cell of a given row:

    add_filter( 'eventorganiser_export_tickets_cell', function( $cell, $column, $ticket ) {
    
        if ( 'booking_gateway' !== $column ) {
            return $cell;
        }
    
        $gateway = eo_get_booking_meta( $ticket->booking_id, 'gateway' );
        return $gateway;
    
    }, 10, 3 );
    

    That code should go in a site utility plug-in but will also work in your theme’s functions.php

    Stephen Harris
    #21622

    Stephen:

    Thank you for the response, but it is not working. The gateway field is not being filled in on the output.

    Is there something that I should be looking out for that is interfering with the functions.

    Thanks.

    Greg

    Greg MacKinnon
    #21624

    Hi Greg,

    My apologies there was a typo, $ticket->booking_ticket_id should have been $ticket->booking_id. I shall correct that now.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 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.