• Resolved gabrielqf

    (@gabrielqf)


    I have added custom form fields for the booking, and they’re working fine for non registered users. But for registered users the booking_meta column isn’t written, how can i fix that ?

    for reference i add the the new info to booking_meta throught :
    $EM_Booking->booking_meta[‘registration’][‘cracha’] = $_REQUEST[‘cracha’];. ( cracha = id Card Name to a max of 20 characters )

    This field is shown to registered users, but even if they fill it the information isn’t written on the DB.
    Maybe i’m wrong trying to make these changes through the em-actions.php
    Any ideas/tips ?

    http://ww.wp.xz.cn/extend/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    You’d have to hook into filters like em_booking_get_post and em_booking_save to save that information. The place you’re adding it in booking_meta should be in ‘booking’, not ‘registration’

    Thread Starter gabrielqf

    (@gabrielqf)

    I tried to add an action hook to em_booking_save and to em_booking_add, but it’s still not working for registered users.

    function em_booking_save_plus() {
    $_REQUEST[‘cracha’] = (!empty($_REQUEST[‘cracha’])) ? $_REQUEST[‘cracha’]:”;
    $EM_Booking->booking_meta[‘booking’] = array(‘cracha’ => $_REQUEST[‘cracha’]);
    }
    add_action(’em_booking_add’,’em_booking_save_plus’);
    add_action(’em_booking_save’,’em_booking_save_plus’);

    I’m at a loss as to why registered users aren’t getting the fields saved. The booking_meta column is only written as of a unregistered user creating a booking.

    hi,

    you’d have to save them somewhere like in the em_meta table or in the booking_meta field of the booking table (stored as a serialized array, so add to it, don’t replace it) and bring it up elsewhere. If you read the tutorials, you could quite easily add extra fields etc.

    http://wp-events-plugin.com/tutorials/ – slightly different walkthrough, but similar concept

    Thread Starter gabrielqf

    (@gabrielqf)

    Thanks for the help!
    I discovered that i needed to alter one more function for registered users input to be saved. Now everything is working quite fine.

    Now i have only one more request, and that would be to know wich function would i call to add a special booking to a user if, and only if, he submitted a file through another plugin ? If he submitted the file i have a script that e-mails him, i want to make this “e-mail script” book a place for him too. Is that possible ? ( if this needs another topic, please tell me )

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Events Manager] Custom Booking Data for Registered Users’ is closed to new replies.