Search Results for 'booking form'

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

Viewing 15 results - 31 through 45 (of 932 total)
  • Author
    Search Results
  • #40566

    Stephen Harris

    Hi Joe,

    For errors to appear you’ll need to add them to a form element (e.g. the ticketpicker element):

    <?php
    add_action( 'eventorganiser_validate_booking_submission', function( $input, $form, $errors ){
    
        // Prevent booking more than 2 tickets
        $ticketpicker = $form->get_element( 'ticketpicker' );
        $tickets = count($ticketpicker->get_value());
    
        if($tickets > 2) {
            $ticketpicker->add_error( 'too_many_tickets', 'You may only book 1 ticket for this event.' );
            return $input;
        }
    
        // Prevent multiple confirmed bookings
        $event_id = $input['event_id'];
        $occurrence_id = $input['occurrence_id'];
    
        $confirmed = eventorganiser_get_bookings( array( 
            'status' => eo_get_confirmed_booking_statuses(), 
            'fields'=>'ids',
            'occurrence_id'=> $occurrence_id, 
            'event_id'=> $post->ID 
        ));
    
        $ticketpicker = $form->get_element( 'ticketpicker' );
    
        if(count($confirmed) > 0) {
            $ticketpicker->add_error( 'too_many_bookings', 'This event is no longer accepting bookings.' );
        }
    
        return $input;
    }, 20, 3);
    

    <

    p>“`</p>

    <p>.</p>

    #40565

    Stephen Harris

    No, events can have any any number of bookings.

    Bookings are created in the post table, but they joined to events via the eo_booking_tickets table. The booking ID and event ID (and occurrence ID) are indexed on that table to allow for quick look-ups. Computing of available spaces is also cached, as that will need to pull out all confirmed bookings for an event.

    You may want to perform load tests, however. As for any given CPU/memory there will come a point where it will struggle. Additionally a lot depends on what other plug-ins you have running and what they might be doing.


    Rene Kroes

    Hi,

    Besides from the limits that we set for the number of tickets available, is there a technical limit to the number of tickets/reservations made for a single event?

    Can I use this for an event where I expect to have 3000 registrations?

    thanks in advance!

    #40498

    Joe Fairlamb

    Hi Stephen, Im trying to implement this code so that I can both limit purchasers to 2 tickets max. I have added it to my functions.php as follows but currently have the following issues:

    1. does not prevent more than 2 tickets being purchased in 1st transaction
    2. does prevent second transaction but does not show error message

    any help would be much appreciated, cheers!

    function xmas2021_limit_tickets_in_booking( $input, $form, $errors ){

    $input = $input + array( 'event_id' => 0, 'occurrence_id' => 0, 'gateway' => false, 'tickets'=>array() );
    $tickets = $input['tickets'];
    $post_id = $input['event_id'];
    $occurrence_id = $input['occurrence_id'];
    
    /* $tickets is an array ( ticket type ID => quantity purchased ). 
       Remove ticket types that have not been selected (0 quantity) */
    $tickets = array_filter( $tickets );
    
    /* Throw error if user has previously made a booking for this event */
    

    if( eo_user_has_bookings( get_current_user_id(), $post_id, $occurrence_id ) ){
    //This error will prevent the booking from being processed, and display the given error message
    $errors->add( 'previous_booking', 'You have already bought tickets for this event.' );
    }

    /* Count how many tickets are in this booking */
    $total_qty =0;
    if ( $tickets ) {
        $total_qty = array_sum( $tickets );
    }
    
    /* Throw error if booking contains multiple tickets */
    if( $total_qty > 2 ){
        $errors->add( 'too_many_tickets', 'You can only purchase two tickets maximum.' );
    }
    
    return $input;
    

    }
    add_action( 'eventorganiser_validate_booking_submission', 'xmas2021_limit_tickets_in_booking', 20, 3 );

    • This reply was modified 3 years, 7 months ago by  Joe Fairlamb.
    #40429

    In reply to: Cookies


    Stephen Harris

    Hi,

    It also sets the cookie eopBookingSession when a booking is made. This doesn’t store any user data, only a signed token containing the booking ID. This is solely used to determine that a booking is in progress (e.g. if the user is redirected to another site as part of the booking process, or if they refresh the page while booking).

    This type of cookie arguably falls into the security/authentication usage, so probably doesn’t need consent (at least on my reading of the ICOs guidance, though I appreciate that is only applicable to the UK). Nor can it be disabled. It is only set when you create a booking.

    As for Google maps, I don’t think it stores cookies (see https://mapsplatform.googleblog.com/2011/10/a-grab-bag-of-maps-api-news.html) – I’ve checked my local test site and I couldn’t see any cookies being stored.

    #40417

    Stephen Harris

    Sorry Sven, I’ve been trying to replicate this without success. Are you able to provide a link to an event, so I can verify there are no errors in the booking UI that might prevent the booking email from being sent? If you don’t want to publish it here, you can use this form: https://wp-event-organiser.com/contact

    The other thing you can do is enable this plugin to verify that emails are not being sent rather than not being received..

    #40073

    Stephen Harris

    Hi Kamil,

    If this is an existing booking form, you might need to re-order it and re-save a couple of times.

    If it persists to incorrectly order the fields, let me know and I’ll be in touch to investigate this further for you.

    #40067

    Kamil Konečný

    Hellloi Stephen,
    I’m fighting with the issue about mailing bookies. I as a organiser get the information about new booking but the bookie not recieve any mail from the system. I try to send them email by “Email bookees” but the bookie not recieve it.
    I had installed the latest EO version (3.10.7 and 3.2.0 of PRO) on WordPress 5.7.2.

    May be will be also good to have option in “Email bookees” to send copy to event organiser.

    Thanks for looking on the problem Kamil

    #39998

    Rolf Hillen

    Hi Stephen,

    we have a very similiar problem. We show the events in an accordion via eo_events shortcode and a customized shortcode-event-list.php. There is also an initial event_booking_form_id shortcode on that page.

    When opening the accordion, we replace this initial form via ajax by an new event_booking_form event_id shortcode (with the id of the selected accordion tab).

    Though that didn’t solve the problem, I guess because of the javascript. Do you see any way to make this work?

    Thanks

    Rolf

    #39944

    Stephen Harris

    Hi,

    The latest version of Pro should resolve this issue. You may need to re-order and re-save the booking form twice before it is corrected.

    The issue was due to relying on index of the element which proved to be unreliable. There is now an explicit ordering. After the first save the elements should have that property, and you should then be able to reorder the elements again to the correct position and save them.

    #39856

    Stephen Harris

    Hi Michael,

    Unfortunately not. You could use some javascript to pre-fill the first set of fields, or CSS to hide them. But the plug-in doesn’t assume that the user making the booking is necessarily an attendee (or that the attendee fields are asking for the same information asked for on the booking).

    #39854

    Stephen Harris

    No, pending events are not visible on the public calendar.

    If you wanted them to be public you could register a custom post status and automatically assign them that status. However, any logic (e.g. allowing or not allowing bookings) for a particular event status would have to be implemented yourself.

    Events are just a post type, so you can use register_post_type (https://developer.wordpress.org/reference/functions/register_post_status) to register a new post type with 'public' set to true. It should then behave like a “confirmed” event. If you wanted to prevent bookings for an event with that new post type you could change the booking form template to remove the form. (templates/eo-booking-form.php)

    #39846

    In reply to: 3.2.0 wp-hooks?


    Stephen Harris

    Hi Anders,

    Event Organiser Pro used to ship with the ‘wp-hooks’ javascript library before it was included in WordPress itself. Its a javascript “port” of the PHP filters/actions and was included to allow extensions to modify the booking form (e.g. so discount codes extension could modify the total on the client side). The WordPress-bundled version is newer, and had a breaking change.

    However the WordPress-bundled version of wp-hooks is not loaded by default on the front-end but where another plug-in caused it to be loaded it caused an issue (in particular discount codes appeared invalid).

    The update just switched to using the WordPress-bundled version. So unless you are using discount codes – you can upgrade without any adverse effects. If you are using discount codes, just ensure you’re using the latest version of discount codes.

    #39804

    Vic Ratnieks

    Hi,

    Is there a way of adding the FES form to the Full Calendar widget so that you can click on a day that does NOT have an event and that day becomes the default day of the booking being made?

    The customer then fills in the rest of the form and the dates they have requested are marked pending until approved so no one else can book them?

    Can the FES form be modal, or be used by a modal plugin like OceanWP modal?

    Cheers, Vic

    #39778

    In reply to: Errors after upgrade


    Stephen Harris

    Downgrading to that version shouldn’t be a problem.

    If anything is causing the duplicate bookings it will be something client-side (javascript). It might be difficult to determine what exactly is causing it though.

    If you can provide access to the site, get in touch via the contact form I can take a look (or if you need the older version to revert to).

Viewing 15 results - 31 through 45 (of 932 total)