Hi,
Thank you in advance for your support. I have a few questions about the booking form:
1. At the moment I have many customers who enter their details into the booking form and then exit the gateway without confirming their payment. The problem is that their bookings are registered as pending and once they return on the website again the booking form only notifies them that they have already made a booking but does not give an option to pay for the pending bookings. I was wondering how could I render a booking cart before the booking form?
- The gateway I am using requires valid telephone numbers and post codes – is it possible to add data validation for these particular fields before the user is allowed to submit the booking?
Kind regards,
Vilius

Vilius Metelionis
Hi Vilius,
I’ll look into adding that first feature for 1.7 (at the very least it shouldn’t display “you’ve already booked” if they’ve not paid ;).
Regarding the second proposal, in 1.7 I’ll be updating the booking form API to allow callbacks to be hooked onto the form validation to allow validity checks of data. This is already possible:
function my_booking_validation_callback( $input, $form, $errors ){
//Save custom booking meta
foreach( $form->get_elements() as $element_id => $element ){
$data = $input[$element_id]; //What the user entered for the form element $element_id;
$type = $element->type; //The element type, e.g. 'phone'.
//Add an error if you wish....
$errors->add( 'my-error-code', 'This message appears on the form' );
}
//If user input can be modified to ensure its correct, you can do so by changing $input.
//but obviously you don't want to change the meanting of whats entered
//Return $input.
return $input;
}
add_filter( 'eventorganiser_validate_booking_submission', 'my_booking_validation_callback', 10, 3 );
(but 1.7 will make some changes to make this easier – all backwards compatible). Phone/post-code validation isn’t handled by EO because what is a valid telephone / post code varies wildly between countries – and if it included it, it’ll end up breaking something, somewhere :).

Stephen Harris