
Bond Nwonye
Hello Stephen,
Where can one style the “Login In” button? In the file booking-form-handler.php, there is a reference to #eo-booking-login-toggle, so I searched for this term to see if it will lead me to the button. No luck.

Bond Nwonye
Hello Stephen,
I copied over includes\booking-form-handler.php to my child theme and amended the typo that says “Not got an account? Click here.” to “Don’t have an account? Click here.”
The change didn’t propagate . I have cleared cache a couple of times too. I am wondering if it’s because we can’t child-theme files in the include directory. If so, how can I amend without touching the parent file?

Karl Lettenström
Oh yeah, i mean.. i do know that the JS only affects what you see, but what i ment was that even as i save the amount as meta, _eo_booking_booking_amount still contains a “false number” witch adds to the sum total while looking at the bookings in admin. But even if i could get a way to fetch the number of tickets and than manipulate that meta, there would still be showing the wrong sum.
I’d love to hear more about the ticket-picker-thingie!
And i’m also just fine with adding another ticket by clicking that button!
array('id' => 'pick asdf',
'type' => 'select',
'required' => true,
'options' => $asdf,
'label' => 'Pick one asdf:',
'description' => "desc...",
'class' => "col-md-4", )
gives this results:
<div id="eo-booking-form-element-wrap-pick asdf-eoc1" class="eo-booking-field eo-booking-form-element-select"> <label class="eo-booking-label" for="eo-booking-field-pick asdf-eoc1">
Pick one asdf:*
</label>
<select id="eo-booking-field-pick asdf-eoc1" name="eventorganiser[booking][pick asdf-eoc1]" class="col-md-4 eo-booking-field-select" style="">
</select>
<p>
desc...
</p>
</div>

Kevin Johannesen
Hi
How to add a field in the form based on a value from another field?
My customers must insert a number of tickets and give each ticket a name.
Kevin

Nicolas Gauthier-Pin
I’m trying to add some +/- buttons next to the ticket quantity field on the booking form. The default spinner on some browsers is not very easy to see. I created the buttons with a few lines of javscript and got to make them edit the field value. Where I’m having trouble having that new value processed.
Clicking on + will increment the “quantity” field by 1, but the form still acts like the value didn’t change. So if there was 1 ticket and I click on +, the field will change to 2, but the form will act like the value is still 1.
Is there some function or ajax event that I need to tap into on my script?

anthony pennacchio
Hi,
I changed the date of an event after the event had passed and now it’s not showing the booking form for the new date.
Do I have to create a totally new event for this?
Thank you

Greg MacKinnon
For what it’s worth, I implemented generally as described above.
I have a conditional statement for each booking template. In this way, I am able to ask a different set of questions for each event type.
I modified my CSV output to include a column for every question. Of course, there is a lot of overlap (i.e. every template asks for name, organization and e-mail), but there are some unique questions as well (i.e. meal choice versus events with no meals). The resulting output includes values where there are values and blanks where there are none, which is just what I need.
I elected to make no changes to the Admin table because I found that too much information on that page was crowded. The CSV ticket output is now exactly the information needed at the door. I simply filter for the event and then download the tickets for the person at the door to use as a checklist.

Alex Steer
Ok, I see what you mean… The CSV is not so much a problem as the cells could just be empty – the data is better seperated on this for working with formulas in excel.
So, if I had a generic column name title in the admin could the data be switched like below?:
$detailsa = eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-title', true );
$detailsb = eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-ticket', true );
switch( $column ){
case 'ticket_admin_column':
if ($detailsa != '') {
return $detailsa;
} elseif ($detailsb != '') {
return $detailsa;
} else {
}
break;
}, 10, 3 );
-
This reply was modified 9 years, 5 months ago by
Alex Steer.

Stephen Harris
Can I get the admin attendee questions ticket columns to only show if they have data (it may be setup that way already, please comment)
In general its not possible to know in advance if a column will have any values, it creates these on the fly. This is further complicated by the fact that a CSV export could include tickets from either event, and so require the columns for each.
On thing you could do is merge the columns: define a common header and then for the cell callback determine which event the ticket is associated with (if required). Just in case, for example, you are using a different element ID.
add_filter( 'eventorganiser_export_tickets_cell', function( $cell, $column, $ticket ) {
//How to get the event ID from a given $ticket object.
$booking_id = $ticket->booking_id; //Booking ID
$event_id = eo_get_booking_meta( $booking_id, 'event_id' ); //Event ID
//For the appropriate value of $column return the cell content
//which can be based on the $event_id above.
}, 10, 3 );
Incidentally – you can use the same element ID on different booking forms, it only has to be unique within that form. So, for example, if you have different meal choices for event A and event B, just add an element with ID ‘meal_choice’ and switch the ‘options’ parameter based on the options available for that event.

Alex Steer
Hi I’m wanting to make my attendee questions condition based upon: $form->get( ‘name’ ) as discussed.
I will have two events let’s say ‘event-a’ and ‘event-b’ and both will have seperate booking forms.
I know that I can make the questions conditional but how do I make sure the associated actions & filters are conditional to only work with the intended attendee questions?
function my_attach_attendee_questions( $form->get( 'event-a' ) ){
Code here
add_action( 'eventorganiser_get_event_booking_form', 'my_attach_attendee_questions', 5 );
add_filter( 'eventorganiser_export_tickets_headers', function( $columns ) {
Code here
}, 10, 3 );
add_filter( 'eventorganiser_booking_tickets_table', function( $columns ){
Code here
});
add_action( 'eventorganiser_booking_tickets_table_column', function( $column_name, $item ){
Code here
},10,2);
add_filter( 'eventorganiser_email_ticket_list', function( $booking_table, $booking_tickets, $booking_id, $template ) {
Code here
}, 10, 4 );
add_filter( 'eventorganiser_notify_confirmed_booking', function( $send_default_email, $booking_id ) {
Code here
}, 10, 2 );
Is there a way to make them work let’s say within the ‘event-a’ function so I could create another set for ‘event-b’?
Thanks

Alex Steer
Thanks Stephen – I have this working now. This may help others so the code is as follows:
add_filter( 'eventorganiser_email_ticket_list', function( $booking_table, $booking_tickets, $booking_id, $template ) {
$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;">
<thead style="font-weight:bold;"><tr> <th>%s</th><th> %s </th> <th>%s</th><th>%s</th></tr></thead>
<tbody>',
__( 'Ticket', 'eventorganiserp' ),
__( 'Price', 'eventorganiserp' ),
__( 'Ref.', 'eventorganiserp' ),
__( 'Attendee', 'eventorganiserp' )
);
foreach ( $booking_tickets as $ticket ) {
$name = eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-name' );
$booking_table .= sprintf(
'<tr> <td>%s<td> %s </td> <td>%s</td><td>%s %s</td></tr>',
esc_html( $ticket->ticket_name ),
eo_format_price( $ticket->ticket_price ),
$ticket->ticket_reference,
$name[0],
$name[1]
);
}
$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;
return $booking_table; }, 10, 4 );

Alex Steer
add_filter( ‘eventorganiser_email_ticket_list’, function( $booking_id, $template ) {
$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;">
<thead style="font-weight:bold;"><tr> <th>%s</th><th> %s </th> <th>%s</th><th>%s</th></tr></thead>
<tbody>',
__( 'Ticket', 'eventorganiserp' ),
__( 'Price', 'eventorganiserp' ),
__( 'Ref.', 'eventorganiserp' ),
__( 'Attendee', 'eventorganiserp' )
);
foreach ( $booking_tickets as $ticket ) {
$booking_table .= sprintf(
'<tr> <td>%s<td> %s </td> <td>%s</td><td>%s</td></tr>',
esc_html( $ticket->ticket_name ),
eo_format_price( $ticket->ticket_price ),
$ticket->ticket_reference,
$name = eo_get_booking_ticket_meta( $ticket->booking_ticket_id, '_eo_booking_meta_attendee-name' )
);
}
$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 array( $booking_table, $booking_tickets, $booking_id, $template );
}, 10, 2 );
I’m not sure what I am doing wrong – im guessing it’s to do with the way I am returning?
??
I have place this before the eventorganiser_notify_confirmed_booking filter.
Thanks

CYCOffice
Thanks again,
I tried editing a child template version of eo-booking-form.php to add a test for if the Member Only category was set. but it never goes to the echo statement below.
I must be doing something wrong, sorry, but still feeling my way with php.
if ( !is_user_logged_in() && in_category('Member Only') ) {
echo "Member only event - login to make a booking";
}
else { //logged in or "public event"
//Display the booking form
?>
<form method="post" action="<?php echo get_permalink().'#eo-bookings';?>" id="eo-booking-form" autocomplete="off">
<?php
//Display custom fields
$this->display_form_fields();
?>
</form>

Stephen Harris
Hi Louise,
You’ll want to make two changes. One to the booking form template (templates/eo-booking-form.php
) to hide the booking form. There is already logic in that template relating to whether a form should be displayed, so you can adapt it there. How to check whether the user is actually a member will depend on the membership plug-in you are using.
Secondly, as a ‘security’ measure, you’ll want to check when the booking form is being processed that the current user is not a member. While the booking form wouldn’t have been displayed a user could still making a booking with an appropriately crafted POST request.
To prevent this, just add the following code, adapted for your membership plug-in.
add_action( 'eventorganiser_validate_booking_form_submission', function( $form ) {
if ( /* user is not a member */ ) {
$form->add_error( 'members-only', 'You must be a member to place a booking' );
}
} );
I would recommend implementing this first, so that you can easily test it before hiding the booking form.

CYCOffice
Hello,
I need to make some booking forms accessible to members of my site and some accessible to the general public.
How do you recommend I add conditional logic to hide the form if the event is “members only”?
Thanks for any advice.