Search Results for 'booking form'

WordPress Event Management, Calendars & Registration Forums Search Search Results for 'booking form'

Viewing 15 results - 331 through 345 (of 932 total)
  • Author
    Search Results
  • #24672

    Stephen Harris

    Hi Will,

    It is possible. The discount plug-in does something similar (adds a field to the booking form, which when matches a valid discount code, discounts an amount from the total).

    The VAT extension doesn’t use a booking form field, but does demonstrate how you can alter the booking price: https://github.com/stephenharris/Event-Organiser-VAT

    In short, you’d need to write some PHP code which filters the booking price (as demonstrated in the VAT Plug-in or discount codes plug-in) and alter its value based on the information store with the booking form (i.e. eo_get_booking_meta( $booking_id, 'meta_{form-field-id}'); where {form-field-id} is the ID of your booking form.

    You will probably want to (but it is not essential) add a JavaScript event to listen for the change in selected valued for your select field and update the total on the booking form itself (again, the VAT extension and discount codes demonstrate how to do this). This is purely aesthetic, it’s the PHP code that determines the amount the user is charged.

    #24540

    Brian Hanna

    I’ve been doing a lot of looking through the site docs and through the codebase and am having a problems trying to figure out how to add custom field types to the form customizer (and then customizing the output on the front-end).

    As the most basic example, we have a custom taxonomy registered to events. We would like people to be able to add a dropdown for the custom taxonomy to their submission forms just like with categories and tags.

    I found the custom-taxonomies.php file which seems to hook into eventorganiser_event_form_element_types and looks like it should already be adding any object taxonomies registered to the event CPT (which I have registered both through the eventorganiser_event_properties hook and through register_taxonomy‘s second parameter. Tried adjusting the priority on the hook with no luck. Maybe this just isn’t linked up yet?

    I understand that there already seems to be a well documented API for adding custom fields to the booking form via hooks and element factories. Does this functionality exist for FES in some sort of undocumented state? I’m sure it is something you are working towards but wondering what is available as of now.

    P.S. for now, we have been able to use the ability to specify a hook name to render custom fields, but it’s not the most user friendly option! However, it works – so good looks.

    #24514

    Jade Deverill

    Hi you help me set up a plugin so that I could have multi tickets (different names and emails) in one booking.

    I.e there would be a ‘book’ they would enter there name and email, then select how many tickets. That would present a drop down with the corresponding amount of tickets where it asks for individual names, email, dietary etc.

    However upon exporting it only exports the bookee name and not the individual ticket names. I need the ticket names and not the bookee name.

    However I’m not sure how to go about this, it’s getting a bit urgent as our event is on the 15th an we have name cards etc to write out.

    I’ve included the custom multi ticket plugin you helped me with originally incase that is needed.

     <?php
    /*
    Plugin Name: Event Organiser - Multi ticket options
    Description: Code snippets for my site
    Version: 1.0
    License: GPL
    Author: Jade Deverill
    Author URI: url
    */
    
    function my_attach_attendee_questions( $form ){
    
        $attendee_fields = array(
            array(
                'id'   => 'attendee-name',
                'type' => 'name',
                'required' => true,
            ),
            array(
                'id'   => 'attendee-email',
                'type' => 'email',
                'required' => true,
            ),
            array(
                'id'       => 'attendee-phone',
                'label'    => 'Phone',
                'type'     => 'input',
                'required' => true,
            ),
            array(
                'id'       => 'attendee-dietary',
                'label'    => 'Dietary Requirements',
                'type'     => 'input',
                'required' => true,
            ),
            array(
                'id'       => 'attendee-seating',
                'label'    => 'Seating Requests or Comments',
                'type'     => 'input',
                'required' => true,
            ),
                    array(
                'id'       => 'attendee-babyname',
                'label'    => 'Angel Baby Name',
                'type'     => 'input',
                'required' => false,
            ),
        );
    
        $attendee_questions = $form->get_element( 'attendee-questions' );
    
        if ( ! $attendee_questions ) {
    
            $ticketpicker = $form->get_element( 'ticketpicker' );
            $position     = intval( $ticketpicker->get( 'position' ) ) + 1;
            $parent       = $ticketpicker->get_parent();
            $parent       = ( $parent ? $parent->id : false );
    
            $attendee_questions = EO_Booking_Form_Element_Factory::create(array(
                'id'           => 'attendee-questions',
                'type'         => 'attendee-questions',
                'elements'     => $attendee_fields,
                'ticket_label' => "Ticket: {{{ticketname}}}",
            ));
    
            $form->add_element( $attendee_questions, array( 'at' => $position, 'parent' => $parent ) );
    
        } else {
            //Attenee questions field already exists, optional: over-ride with our elements
            $attendee_questions->set( 'elements', $$attendee_fields );
            $attendee_questions->_modelElements->set( $attendee_questions->get('elements'), array( 'form' => $form ) );
        }
    
    }
    add_action( 'eventorganiser_get_event_booking_form', 'my_attach_attendee_questions', 5 );
    
    
    add_filter( 'eventorganiser_export_tickets_headers', function( $columns ) {
        $columns['ticket_first_name']   = 'Ticket Holder (first name)';
        $columns['ticket_last_name']    = 'Ticket Holder (last name)';
        $columns['ticket_email']        = 'Ticket Holder Email';
        $columns['ticket_phone']        = 'Ticket Holder Phone Number'; 
        $columns['ticket_dietary']        = 'Ticket Holder Dietary Requirements';   
        $columns['ticket_seating']        = 'Ticket Holder Seating Requests or Comments';
        $columns['ticket_babyname']        = 'Angel Baby Name';
        return $columns;
    } );
    
    
    add_filter( 'eventorganiser_export_tickets_cell', function( $cell, $column, $ticket ) {
    
        switch( $column ){
    
            case 'ticket_first_name':
                $name = eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-name' ); //_eo_booking_meta_{field id}
                if ( $name ) {
                    return $name[0]; //$name is an array: array( 'first name', 'last name' );
                } 
                return '';
                break;
    
            case 'ticket_last_name':
                $name = eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-name' ); //_eo_booking_meta_{field id}
                if ( $name ) {
                    return $name[1]; //$name is an array: array( 'first name', 'last name' );
                } 
                return '';
                break;
    
            case 'ticket_email':
                return eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-email', true ); //_eo_booking_meta_{field id}
                break;
    
            case 'ticket_phone':
                return eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-phone', true ); //_eo_booking_meta_{field id}
                break;
            case 'ticket_dietary':
                return eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-dietary', true ); //_eo_booking_meta_{field id}
                break;
            case 'ticket_seating':
                return eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-seating', true ); //_eo_booking_meta_{field id}
                break;
            case 'ticket_babyname':
                return eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-babyname', true ); //_eo_booking_meta_{field id}
                break;
    
            default:
                return $cell;
        }
    
    }, 10, 3 );
    
    
    
    
    /**
     * Add a column for displaying booking ticket meta
     */
    add_filter( 'eventorganiser_booking_tickets_table', function( $columns ){
    
        list($value, $key) = array(end($columns), key($columns));
        unset($columns[$key]);
    
        $columns['name'] = 'Ticket owner';
        $columns['email'] = 'Email';
        $columns['phone'] = 'Phone';
        $columns['dietary'] = 'Dietary';
        $columns['seating'] = 'Seating';
        $columns['babyname'] = 'Baby Name';
        $columns[$key]   = $value;
    
        return $columns;
    });
    
    
    /**
     * Display booking ticket meta
     */
    add_action( 'eventorganiser_booking_tickets_table_column', function( $column_name, $ticket ){
        if( 'name' == $column_name ){
            $name = (array) eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-name' );
            echo esc_html( implode( ' ', $name ) );
        } elseif( 'email' == $column_name ) {
            echo esc_html( eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-email', true ) );
            } elseif( 'phone' == $column_name ) {
            echo esc_html( eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-phone', true ) );
            } elseif( 'dietary' == $column_name ) {
            echo esc_html( eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-dietary', true ) );
            } elseif( 'seating' == $column_name ) {
            echo esc_html( eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-seating', true ) );
                    } elseif( 'babyname' == $column_name ) {
            echo esc_html( eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-babyname', true ) );
        }
    },10,2);
    
    #24505

    Stephen Harris

    Hi Dan,

    As you’ve noted the name field is removed for logged-in users. He’s a snippet which will re-add it back in. I’ve left so that it will always appear for logged-in users, but you may want to adjust it slightly so it only appears if the user does not have a first and/or last name stored.

    This should go in a custom plug-in, but will also work in a theme’s functions.php:

    <?php
    
    /**
     * Add the removed name fields if the user is logged-in.
     */
    add_action( 'eventorganiser_event_booking_form_render', function( $form ) {
        if( is_user_logged_in() && !$form->get_element( 'name' ) ){
            $current_user = wp_get_current_user();
            $element = EO_Booking_Form_Element_Factory::create( array(
                'id'         => 'name',
                'type'       => 'name',
                'field_name' => 'name',
                'required'   => true,
                'label'      => __( 'Name', 'eventorganiserp' ),
                'value'      => array(
                    'fname' => $current_user->user_firstname,
                    'lname' => $current_user->user_lastname,
                )
            ) );
            $form->add_element( $element, array( 'at' => 0 ) );
        }
    } );
    
    /**
     * Currently, if the user is logged-in, the booking form will forcebly 
     * set the name fields to that of the logged-in user. So we update the
     * user's name before that happens.
     */
    add_action( 'eo_booking_form_submission', function( $raw_data, $form_id, $form ) {
        if( is_user_logged_in() && $form->get_element( 'name' ) ){
            $name = $form->get_element( 'name' );
            global $current_user;
            $current_user = wp_get_current_user();
            $current_user->user_firstname = $name->get_value( 'fname' );
            $current_user->user_lastname = $name->get_value( 'lname' );
        }
    }, 10, 3 );
    
    /**
     * The booking form has been validated. We now update the database with the user's names
     */
    add_action( 'eventorganiser_process_booking_form_submission', function( $form ) {
    
        if( is_user_logged_in() && $form->get_element( 'name' ) ){
            $name = $form->get_element( 'name' );
            wp_update_user( array(
                'ID' => get_current_user_id(),
                'first_name' => $name->get_value( 'fname' ),
                'last_name' => $name->get_value( 'lname' ),
            ) );
        }
    
    } );
    
    #24502

    Dan Brady

    I want to be able to collect the first name and last name on the booking form.

    By default the first name and last name are hidden when a user is already logged in. However, we have many users for whom we don’t have the first name and last name fields.

    How can I make first and last name required fields on event booking forms?

    Thanks

    Dan

    #24474

    Stephen Harris

    Hi Tristan,

    It sounds like adding the IP restriction will fix the symptom. If you wanted to diagnose the cause you can try this snippet (put it in a mu-plugin, or similar) to log when a booking is made, to which gateway and the execution path:

    <?php
    
    add_action( 'eventorganiser_pre_gateway_booking', function( $booking_id, $booking, $gateway, $form->errors, $form ) {
    
        error_log( "Booking $booking_id with gateway $gateway" );
        error_log( wp_debug_backtrace_summary() );
    
    }, 1, 5 );
    

    If you find that a booking is duplicated, check for the the corresponding lines in your error logs, and feel free to paste the corresponding logs over. Of particular interested is what is logged from wp_debug_backtrace_summary() – this will be a list of function calls that describe the execution calls. This will help determine why the booking is being created twice.

    #24463

    Stephen Harris

    Tristan,

    Apologies for the barrage of replies. Can you confirm your Event Organiser Pro version? As the plug-in may already disable the booking form submit button once its first clicked. If so, this effectively rules out users double-clicking the button.

    If so, I’ll be in touch via email about how to go about diagnosing the problem.

    #24278

    Chris Plummer

    Hi,

    I have a questions regarding ‘Bookings are no longer available for this event.’
    I get this message, but there is no single booking and tickets are available.

    Screenshot attached: http://imgur.com/a/qztcJ

    I’m a bit confused, how can I debug this?
    This is my local install, I’m a developer, and I’m using:

    <?= eo_get_booking_form($post_id); ?>
    

    Inside my custom template.

    Thanks in advanced

    #24207

    Jon Packman

    Hi, my client’s customer is unable to change his card used for Stripe payment. He says it is rejecting the new one and reverting to his old saved card.

    Could this be due to the new card type being unsupported, or another reason (apart from invalid details)?

    And how would a customer normally change their card details? Simply enter a new one into the booking form?

    Thanks,

    Jon

    #24050

    Michael Docker

    OK. I figured that one too, using option 2 of your suggested solutions on http://wp-event-organiser.com/forums/topic/editing-styles-for-the-booking-form/.

    #24044

    Michael Docker

    blobs beside radio buttons
    <

    p>The

      default blobs on the radio buttons look confusing to me (see above).<br>I’ve tried adding “list-style-type: none;” to the “.eo-booking-form-element-radio ul” selector in my child theme’s style.css file, but to no avail.

    #24043

    Michael Docker

    I think I’ve answered my own question. I had Simple Booking Mode selected (by default?) on the Ticket Picker form element. After unticking this the form now shows a Quantity selector.

    #23979

    Michael Renner

    Under “Events” I’m missing Bookings and Venues. Also it is no longer displaying the Booking Form or the checkout on the Event page.

    #23952

    Stephen Harris

    Hi Natalie,

    Apologies, I missed your reply.

    I’ve double checked the above code and it works as expected for me, although it can be shortened too:

    add_filter( 'eventorganiser_bookable_occurrences', function( $bookable, $event_id ) {
        return eo_get_the_occurrences_of( $event_id );
    }, 10, 2 );
    

    If that snippet wasn’t working then you should see a message to the effect that the event had sold out or was no longer taking bookings.

    If you’re not seeing such a message, and instead are just not seeing a booking form, then it’s probably not the snippet that’s at fault. In that instance it’s likely due to how the tickets have been configured.

    For example no form will appear if all tickets have quantity 0 (or there are no more tickets available), or if there are no tickets ‘on sale’ (if you have specified a sale period). Importantly, if selling by date, each of your tickets should have at least one date selected for it to appear on the booking form.

    Are you selling by date? And what do you see on the event page?

    #23906

    Stephen Harris

    It should be the case that get_the_ID() will return the ID of the event – this assumes you don’t have dedicated ‘thank you’ page, but instead return the user to the booking page. With the ID of the event you can use ACF’s api to get the stored values.

    That is fairly low-level hook. I’d recommend using this one instead: eventorganiser_booking_form_form_display_notices (see http://wp-event-organiser.com/blog/announcements/event-organiser-pro-1-11-0-rc1/ and https://wordpress.org/support/topic/change-notification-text-in-form?replies=3).

Viewing 15 results - 331 through 345 (of 932 total)