Reservations and bookings

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

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

    Hi,

    I’m using the reservation option for events and the function is okay, even for free events.
    After I did a reservation I see this message:

    “You have already made a booking for this event.”

    But there is still the reservation button and If I hit that button again a second reservation is made. That seems to me wrong. Is there a way to validate double submissions or just hide the button after a reservation is done. Note this happens to logged in users.

    Next is there a way to cancel my reservation? Sure it will never happen for paid tickets this way, but for the free reservations it should be an option. Would be nice if that would be a links after that message I mentioned above.

    Olaf Lederer
    #26507

    By default users can make multiple bookings, and that notice is for just for the user’s information. You can hide the form, however by editing the booking form template file (templates/eo-booking-form.php – copy it to your theme first).

    If you edit the last } else { statement, (~line 55), to an elseif statement following:

    } elseif ( ! eo_user_has_bookings( get_current_user_id(),  get_the_ID() ) ) {
    

    Then the booking form will only appear if the user has not made a prior booking for the event.

    You can use the ‘Booking History’ shortcode on page to display to logged-in users their previous bookings. There’s an option to allow them to cancel their booking.

    You can then use the URL of that page in the notice that appears to users who have previously placed a booking for that event. To edit the message that appears:

    add_filter( 'eventorganiser_booking_form_form_display_notices', function( $notices ) {
         if ( isset( $notices['prior-booking'] ) ) {
              $notices['prior-booking'] = sprintf( 
                'You have a prior booking for this event. <a href="%s">Click here</a> to view your bookings.',
                'http://yoursite.com/url/to/booking-history'
              );
         }
         return  $notices;
    } );
    
    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.