CSV download for bookings

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

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #16210

    Hi Stephen,

    Is there a way to get the plugin to change the output of the bookings CSV download?

    I would like the first name and last name to be in separate columns (using the existing fields if possible).

    Also, how easy and what would be needed to get the booking form to post into to mail chimp?

    Alex Steer
    #16216

    Hi Alex in 1.10.0 (currently in beta) you’ll be able to split the names with a few lines of code. They are merged automatically as some users only take bookings from logged-in users who may only have a username, an no first/last name provided.

    Simply adding the following (see Where should I put code from the tutorials?)

    add_filter( 'eventorganiser_export_bookings_headers', 'my_set_csv_headers' );
    function my_set_csv_headers( $headers ){
    
        //The plug-in will auomatically recognise the bookee_fname & bookee_lname
        //columns, when enabled
        $headers['bookee_fname'] = __( 'Bookee (First name)', 'eventorganiserp' );
        $headers['bookee_lname'] = __( 'Bookee (Second name)', 'eventorganiserp' );
        unset( $headers['bookee'] ); //Remove default, 'Bookee' column
    
        return $headers;   
    }
    
    Stephen Harris
    #16217

    Sorry, I neglected to answer your second question.

    The event organiser side of things Is very straightforward:

    add_action( 'eventorganiser_new_booking', 'my_booking_made_callback' );
    function my_booking_made_callback( $booking_id ){
         $email = eo_get_booking_meta( $booking_id, 'bookee_email' );
         //Send $email to MailChimp via their API
    }
    

    I believe MailChimp have their own PHP implementation of their API which would do the rest. Please note that the eventorganiser_new_booking is triggered when a booking is made (not necessarily confirmed).

    For when a booking is confirmed, you can use the eventorganiser_confirmed_booking hook instead.

    Stephen Harris
    #16219

    Thanks for the speedy reply.

    I setup the plugin as documented – with the code above for splitting the names.

    However, the CSV download has the two new columns but with no data. What am I missing for these to be populated?

    I would like to use the existing form fields if possible.

    Many thanks.

    Alex Steer
    #16221

    Hi Alex,

    That code snippet will only work from 1.10.0 onwards. 1.10.0 is currently in beta, and shall be released shortly after WordPress 4.2.

    I’d be happy to provide you with access to 1.10.0 while it is in beta if this is something you need urgently.

    Stephen Harris
    #16222

    It is important and urgent but I don’t really want to be running something that’s in beta and not yet fully tested. Is there really no other way to get around this?

    Alex Steer
    #16229

    Could the name be split based on the comma when it’s downloaded is there anyway to impliment this?

    Alex Steer
    #16230

    Also, how stable is the 1.10.0 Beta?

    Many thanks.

    Alex Steer
    #16234

    Very. Its been used on a live sites for ~2 weeks now. A beta update is due this weekend. That will likely be the final one until release.

    I’ll be in touch with the mates beta over the weekend.

    Stephen Harris
    #16253

    Hi, do you have the details for the Beta yet?

    Will it work my template/css modifications because I have put a lot of work in customising them?

    Alex Steer
    #16254

    Hi Alex,

    I’m just about to e-mail it to you.

    That would depend. Alterations made to the plug-in files will be lost when you update (for this reason it’s recommended you copy the template files into your theme and edit them there). Regarding the recent update there have been minor changes to the address field template & css (correcting class names etc) – all very minor.

    I can’t say for sure without knowing what modifications you’ve made, but the update is (with the exception of the above) backwards compatible. So I doubt there would be any issues.

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