Booking form

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9564

    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?

    1. 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
    #9565

    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
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.