Search Results for 'booking form'

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

Viewing 15 results - 526 through 540 (of 932 total)
  • Author
    Search Results
  • #16210

    Alex Steer

    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?

    #16203

    Stephen Harris

    Hi Andrew,

    If you append ?eventorganiser[booking][occurrence_id]={occurrence-id} to the end of the url it should automatically select that occurrence indicated.

    So, if you edit the page templates to modify the event url (returned by get_permalink()) then you can get the form to recognise which occurrence to select.

    That’s a bit ugly though, so we can improve things with an endpoint:

    add_action( 'init', 'my_register_endpoint', 15 );
    function my_register_endpoint(){
        add_rewrite_endpoint( 'occurrence', EP_PERMALINK ); 
    }
    

    You’ll need to flush the rewrite rules after this (just re-save your permalink settings). This allows use to use the url:

     mysite.com/events/event/my-event/occurrence/{occurrence-id}
    

    Next, we just need to tell the form:

    add_action( 'eventorganiser_get_event_booking_form', 'my_set_booking_form_occurrence_id', 10, 2 );
    function my_set_booking_form_occurrence_id( $form, $event_id ){
        global $wp_query;
        //Check if an occurrence is given
        if( $wp_query->get( 'occurrence' ) ){
           $occurrence_id =  (int) $wp_query->get( 'occurrence' );
           //Next, check that the booking form hasn't already been given an occurrence ID.
           if( !$form->get_element( 'occurrence_id' )->get_value() ){
              //If not, set the occurrence ID
              $form->get_element( 'occurrence_id' )->set_value( $occurrence_id );
           }
        }
     }
    

    And then as before, just update the page templates to append /occurrence/{occurrence-id}

    So rather than

     get_permalink();
    

    You might have

     get_permalink() . '/occurrence/' . $post->occurrence_id;
    

    There is a filter for the event calendar to change the link there too.


    The reason that this can only be done by editing the template is that the filters inside get_permalink() only pass the post ID, not the post object (which contains the occurrence ID). Therefore those filters are occurrence agnostic. I’d recommend creating the following function to replace get_permalink() for event links:

    function get_event_link(){
         global $post;
         $link = get_permalink();
         if( 'event' == get_post_type() && $post->occurrence_id ){
              $link = trailingslashit( $link ) . 'occurrence/' . intval( $post->occurrence_id );
         }
         return $link;
    }
    
    #16168

    Stephen Harris

    Hi Marco,

    Can you double check that when editing the event’s tickets that the events dates have been selected. You can toggle whether tickets are available for specific dates, however, if you update an event you will need to update it’s tickets also.

    Otherwise the tickets are potentially linked to occurrences that no longer exist, and so will not display. If none of the tickets are displayed then the booking form itself will not display.

    #16164

    Marco Abis

    Hi,

    I searched the foru for similar issues but all I found don’t apply to me.

    Didn’t have any issue with the booking form on previous events, it all worked but now I’ve create a new event (cloning a previous one if that’s important), did my changes but the booking form doesn’t show anymore.

    Here is the live page: https://highops.com/events/official-docker-training-london-may-2015/

    Let me know, thanks


    Aaron Robb

    I’ve got a few custom fields in the Booking Form. When I’m signed in, the normal ‘name/email’ fields disappear, but the custom fields remain up.
    Is there a way to have these fields pre-filled in with the user details? And if so, can they be hidden when signed in?
    So essentially I want a ‘One button registration’ but with custom fields filled in.

    Possible?

    #16065

    Stephen Harris

    Hi Lars,

    This is exactly what is happening in v1.10.0 (currently in beta, if you wanted to get an early copy). As of that update, a lot of the element views have their own template file.

    This makes it a lot simplier to over-ride the template, rather than having to over-ride the default element view class via the eventorganiser_booking_form_element_view filter.

    #16063

    Oliver Meding

    Hi,

    We frequently need very complex layouts and behaviours on our booking forms. Unfortunately, the form elements are hardwired in class-eo-booking-form-element-view.php and thus can’t be customised that easy. Is there a chance to transfer their templates in one or more separate files to gain exact control over the markup?

    Cheers,
    Lars

    #15821

    In reply to: Template customization


    Stephen Harris

    1 – The format can be easily customized as the free version templates?

    Sorry, the format of what? Keep in mind that Pro should be installed alongside the base version, so you’re still able to customise the templates as you do in the base version.

    2 – With a few lines of CSS, yes. In a future update the price column (on the front-end) will be removed for free events.

    3 – Yes, it is translatable. Translations are updated with each release. For the next release the Spanish translation stands at 70% (details on how to translate text can be found here: docs.wp-event-organiser.com/i18n)

    4 – By default bookings are automatically confirmed when payment is confirmed. If the event is free, is immediately confirmed. If the event is paid, but payment is to be made offline then the booking should be confirmed manually.

    With a few lines of code it is possible to alter this behaviour if required.

    #15752

    In reply to: User profiles


    Stephen Harris

    Hi Alex,

    Do you have an example of the code where I am targeting the specific fields I want to capture, rather than excluding the ones I don’t?

    Do you mean, by ID, for example? If so

    $whitelist_ids = array( 5, 8, 12 ); //Array of field IDs to sore
    if( !in_array( $element->id, $whitelist_ids ) ){
         continue;
    }
    

    It’s not yet documented, but all you need to know is that it fires when retrieving a booking form for a particular event, and passes the booking form object and event ID:

    add_action ('eventorganiser_get_event_booking_form', 'my_get_event_booking_form_callback', 10, 2 );
    function my_get_event_booking_form_callback( $form, $event_id ){
         foreach( $elements as $element ){
              //skip elements as required
    
             //set $value based on user meta
             $element->set_value( $value );
         }
    }
    
    #15751

    In reply to: User profiles


    Alex Steer

    Stephen,

    Thanks for your reply.

    I am assuming I would put the above in my functions file, correct?

    Do you have an example of the code where I am targeting the specific fields I want to capture, rather than excluding the ones I don’t?

    This might be a nice feature to add in the UI, maybe a check box on some of the field types like address for instance would work nicely.

    I couldn’t see ‘eventorganiser_get_event_booking_form’ in your codex can you point me in the right direction?

    Many thanks.

    #15745

    In reply to: User profiles


    Stephen Harris

    Hi Alex,

    There are no UI settings to do this, but it’s possible to implement.

    You can copy the from data into user meta as follows. Please note that you’d probably want to skip certain fields (hidden, for example) or only target fields with specific IDs.

    add_action( 'eventorganiser_booking_form_saved', 'my_form_saved_callback' );
    function my_form_saved_callback( $form, $booking_id ){
    
        $bookee_id = (int) eo_get_booking_meta( $booking_id, 'bookee' );
    
        if( $bookee_id <= 0 ){
            return;
        }
    
        $elements = $form->flatten_elements();
    
        foreach( $elements as $element ){
    
            //skip types
            $skip = array(
                'ticketpicker', 'antispam', 'section', 'html', 'discount-code',
                'fieldset', 'hook', 'hidden',
            );
    
            if ( in_array( $element->type, $skip ) ){
                continue;
            }
    
            $value = $element->get_value();
    
            if( !is_null( $value ) ){
                $key   = 'my_prefix' . $form->id . '_' . $element->id;
                update_user_meta( $bookee_id, $key, $value );
            }
    
        }
    
    }
    

    I won’t go into my detail, but you can use the normal WordPress user admin hooks to display this data. You can also ‘pre-fill’ the form by using the eventorganiser_get_event_booking_form hook.

    The difficulty is in ensuring that only ‘appropriate’ data is copied as user meta data (i.e. data that it makes sense to). Custom fields added by the plug-in have no meaning to the plug-in, so it can’t automatically identify which fields hold data associated to the user. How best to handle this usually depends on context.

    #15741

    Alex Steer

    Hi,

    Is it possible to get the information on the booking form to save under the users WordPress profile as well as on the booking?

    Example: if a user enters an address or phone number then it is stored and reusable.

    Please let me know whether this can be done.

    Cheers.

    #15706

    In reply to: Google Analytics


    Stephen Harris

    Yeah templates will be in 1.10.0, and make it much easier.

    Or you can designate a page in the booking form settings for returning users to and then track that url, which is the same principle as you mention above.

    #15702

    In reply to: %tickets% table


    Stephen Harris

    You sure that you have to call 2 x $booking-id?

    No, that was a typo (sorry!)

    Please find an example below. This sets the colour of the table to green, just as an illustration:

    function my_email_template( $booking_table, $booking_tickets, $booking_id ){
    
        if ( -1 == $booking_id ) {
            //Preview, fake data
            $booking_tickets = array(
                (object) array( 'ticket_name' => 'Standard', 'ticket_price' => 12, 'ticket_reference' => 'abc123' ),
                (object) array( 'ticket_name' => 'Standard', 'ticket_price' => 12, 'ticket_reference' => 'def456' ),
                (object) array( 'ticket_name' => 'Student', 'ticket_price' => 10, 'ticket_reference' => 'a1b2c3' ),
            );
            $total_price = 34;
    
        }else {
            $booking_tickets = eo_get_booking_tickets( $booking_id, false );
            $total_price = eo_get_booking_meta( $booking_id, 'booking_amount' );
        }
    
        $booking_table = sprintf(
            '<table style="width:100%%;text-align:center;color:green;">
            <thead style="font-weight:bold;"><tr> <th>%s</th><th> %s </th> <th>%s</th></tr></thead>
            <tbody>',
            __( 'Ticket', 'eventorganiserp' ),
            __( 'Price', 'eventorganiserp' ),
            __( 'Ref.', 'eventorganiserp' )
        );
    
        foreach ( $booking_tickets as $ticket ) {
            $booking_table .= sprintf(
                '<tr> <td>%s<td> %s </td> <td>%s</td></tr>',
                esc_html( $ticket->ticket_name ),
                eo_format_price( $ticket->ticket_price ),
                $ticket->ticket_reference
            );
        }
    
        $booking_table .= apply_filters( 'eventorganiser_email_ticket_list_pre_total', '', $booking_id );
        $booking_table .= sprintf( '<tr> <td>%s</td><td> %s </td> <td></td></tr></tbody></table>', __( 'Total', 'eventorganiserp' ), eo_format_price( $total_price ) );
    
        return $booking_table;
    }
    add_filter( 'eventorganiser_email_ticket_list', 'my_email_template', 10, 3 ); 
    
    #15697

    In reply to: %tickets% table


    edith mayerhofer

    Hi Stephen,

    I couldn’t get this work:

    add_filter( 'eventorganiser_email_ticket_list', 'my_email_tickets_table', 10, 3 );
    function my_email_tickets_table( $html, $booking_id, $booking_tickets, $booking_id){
         //$html is the mark-up for the table. Alter/replace as required.
         //$booking_tickets is a array of tickets. Each ticket in the
         //array as $ticket->ticket_price and $ticket->ticket_name etc.
         //$booking_id is the booking ID. Or it is -1 when generating the e-mail
         //for preview (see Settings > Event Organiser > Bookings)
    
          return $html;
    }
    

    I can style the table header but as soon as I get to the arrays I get errors. You sure that you have to call
    2 x $booking-id?
    function my_email_tickets_table( $html, $booking_id, $booking_tickets, $booking_id)

    May I ask you for an example? I just want to have the table in the same font (Arial) than the rest
    of the email and of course I have to put the headers in german in it. But in the meantime I have it hardcoded.
    But therefore I can wait until version 1.10 – the table formatting probably will not change in 1.10?
    Thank you.

Viewing 15 results - 526 through 540 (of 932 total)