New Pro v3 User with Questions

This topic contains 4 replies, has 2 voices, and was last updated by  Stephen Harris 1 year, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #42618

    We are using the booking option for both free and paid tickets for users that are logged in only.

    1. In my test I am not seeing the First Name or Last Name stored against the booking in backend, export or the notification that goes to the admin. These fields are populated in the WP users table (the username and emails are pulled in).
    2. Notification – on booking an email is send to the site admin, but the Bookee is not getting any notification. I am can’t seem to find a way to enable this?
    Ian Smith
    #42620

    Update – I have the notification working now. Issue was a mis-configured SMTP.

    Ian Smith
    #42626

    Hi Ian,

    By default the display name is used by default. This is because the first/last name might not be provided.

    The content of the notification email sent to the admin user is applied through the filter eventorganiser_notify_confirmed_booking_message, so you can replace the tag there:

    add_filter('eventorganiser_notify_confirmed_booking_message', function($message){
        $message = str_replace('%display_name%', '%first_name% %last_name%', $message);
        return $message;
    }, 10, 1);
    

    You can also add additional columns to the booking/tickets export:

    add_filter('eventorganiser_export_bookings_headers', function($headers){
        $headers['bookee_fname'] = 'First name';
        $headers['bookee_lname'] = 'Last name';
        return $headers;
    }, 10, 1);
    
    Stephen Harris
    #42640

    Thank you, that did the trick.

    Is it also possible to add the first name / last name to the data displayed in the Admin Booking table under “Bookee” ?

    I tried this, but didn’t work:

        //Print column cell
     add_action( 'eventorganiser_booking_table_column', function( $column_name, $item ){
        if ( 'booking_bookee' == $column_name ) {
              echo esc_html( eo_get_booking_meta( $item->ID, 'bookee_first_name' )   );
              echo ' ';
              echo esc_html( eo_get_booking_meta( $item->ID, 'bookee_last_name' )  );
        }
     }, 10, 2 );
    
    Ian Smith
    #42784

    Re-posting here as I replied via email to Ian.

    You can add a column with this code:

    <?php

    add_filter( 'manage_event_page_bookings_columns', function( $columns ) {
        $columns['new_column'] = 'Custom field';
        return $columns;
    }, 20 );
    
    add_action('eventorganiser_booking_table_column', function($column, $booking){
        if ($column === "new_column") {
            echo "content..."
        }
    }, 10, 2);
    

    But you cannot change the content of an existing column. What you would need to do is remove the column you wish to change (unset($columns['column-key-to-remove']) and then add a new column (with a different key);

    You can also re-order columns by re-ordering the associative array in manage_event_page_bookings_columns

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