WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Added drop-down to booking form-how to get value into email (4 posts)

  1. babyatom
    Member
    Posted 1 year ago #

    (I've been using WordPress for years and there's ALWAYS stuff that I get totally, totally stuck on!)

    I've added a 'select a location' drop-down to the event booking form (edited templates/forms/bookingform/booking-fields.php) and simply want whatever is selected to come through in the booking email.

    This is what I've done...
    Added the drop-down 'Select a location' to the booking form:
    <p>
    <label for='Select a location'><?php _e('Select a location', 'dbem') ?></label>
    <select name="select"><?php echo !empty($_POST['select_location']) ? $_POST['select_location']:'' ?>
    <option value="Le Dorat">Le Dorat</option>
    <option value="St Leger Magnezeix">St Leger Magnezeix</option>
    <option value="Bellac">Bellac</option>
    <option value="Ruffec">Ruffec</option>
    </select>
    </p>

    Added this to em-booking.php:
    case '#_SELECTLOCATION':
    $replace = $this->select_location;
    break;

    Then added #_SELECTLOCATION to my email template in WP admin.

    I've no idea what I'm doing but I can usually muddle through. I did read the docs but I don't think I understood them. So this time, as I said at the top, I'm stuck!

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    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

    Also, EM Pro already has this feature.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    if you store anything into the $EM_Booking->booking_meta array during the em_event_get_post_meta filter, it'll get saved into the array, and you can access it later in other situations

  4. babyatom
    Member
    Posted 1 year ago #

    Damn, still don't get it :-( Thanks anyway you two; I'm just not that smart.

    Because I'm a bodger I've cheated and hijacked the 'phone number' field, replacing it with my drop-down. It works, which will do me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.