Add column to admin view Bookings

This topic contains 6 replies, has 2 voices, and was last updated by  Jade W. 4 years, 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #38564

    Hi.We need to be able to view one of the fields from the booking form when looking at all bookings. Currently the parent (adult) makes the booking for their kids so when looking at all bookings under Events > Bookings – we can only see Bookee name and not the kid’s name (the one attending). How can we add an additional column in order to view the kid’s name which is input field on the booking form? Or is there a way to change what appears under the Bookee column which is the WP user to the custom field value instead?
    Thanks

    Jade W.
    #38565

    OK
    I managed to add an extra column using
    add_filter( ‘manage_event_page_bookings_columns’, function( $columns ) {
    $columns[‘_player_name’] = ‘Player Name’;
    return $columns;
    }, 20 );

    I’m confused how to pull booking form fields into the column? I have a input form field ID:23

    Jade W.
    #38582

    Hi Jade,

    You do the following:

    add_filter('eventorganiser_booking_table_column', function($column, $booking){
        if ($column === "_player_name") {
            echo eo_get_booking_meta( $booking->ID, 'meta_23' );
        }
    }, 10, 2);
    
    Stephen Harris
    #38594

    Hi Stephen

    Doesn’t work. It’s not pulling value of field in at all

    Is it echo or return?

    Thanks
    Jade

    Jade W.
    #38595

    All good. Modified code a little and it works now. Thanks

    Jade W.
    #38611

    Glad it’s working for you now. Was the problem with the code snippet I posted?

    Stephen Harris
    #38617

    Hi Stephen. Doesn’t seem to work with return.

    This works for me:

    add_filter( 'eventorganiser_booking_table_column', function( $columns, $booking) {
        if ( '_player' !== $column ) {`
    
            $player_name = eo_get_booking_meta( $booking->ID, 'meta_25' );
    
        }
        echo "$player_name";
    
    
    }, 10, 2); 
    

    I’ve just emailed you for help with automatically creating Mailpoet list when event is published. Thanks!

    • This reply was modified 4 years, 3 months ago by  Jade W..
    Jade W.
Viewing 7 posts - 1 through 7 (of 7 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.