When spaces are set to 0

This topic contains 5 replies, has 2 voices, and was last updated by  Stephen Harris 5 years, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #33854

    Hi,

    If someone publish an event where ”Spaces” is set to 0, then the form will appear (without option to change ticket quantity).
    After filling out/submit the form, a message will appear: ”The tickets you have selected are no longer available.”.

    If however the event starts with ”Space” set to, 4 for example…and a booking is submitted, then if we change space to 0.
    The form will not appear but instead the message ”Bookings are no longer available for this event.”

    We have had users accidentally setting ”Spaces” to 0, then when they preview the event they don’t notice there is no ticket quantity option.
    They only see the form and assumes everything is fine.

    I think it would make more sense to either not show the form at all when spaces are set to 0 or always replace the form with the message ”Bookings are no longer available for this event.”.
    …never show the form which will not work (because spaces are set to 0 ) ?

    We are using the new Beta version

    Thanks!

    AK
    #33890

    The “Bookings are no longer available for this event” only appears if the event has finished (last occurrence has already started),

    If you create tickets then the booking form will appear, unless the event has finished or all tickets currently on sale have sold out.

    I appreciate that some users might see the form and not realise the ticket quantity is set to zero. I’m wary about making any changes, but you can add a check yourself in the eo-booking-form.php template.

    The ticket quantity field is a number field, defaulting to 1. So this field must be have been changed by the user.

    Stephen Harris
    #33912

    Thank you Stephen,

    The “The tickets you have selected are no longer available.” will appear regardless if the event has finished or not, when ticket quantity is set to zero. It will appear after firstname,lastname,email has been filled out + submit. Since the form still has the ticket “field” but without option to set any quantity I guess that triggers this message?

    Could you please elaborate a little how I could add a check for this in eo-booking-form?

    …yes, you are right this is caused because the user for some reason decides to set 0 for ticket quantity (I guess believing it means the same as no limit)

    Thanks!

    AK
    #34173

    Please note there is currently a bug which prevents the below from working. This will be fixed in 2.0.1

    So in the eo-booking-form.php template you can add the following:

    $isAvailable = eventorganiser_list_sum($occurrence_tickets, 'available');
    if($isAvailable > 0 ) {
     //there are tickets available
    } else {
     // there are no tickets available.
    }
    
    Stephen Harris
    #34318

    Thank you Stephen,

    I´m afraid I don’t fully understand, what bug is that?

    Should your snippet best be placed/integrated inside the last “else” at row 55 ?

    Thanks!

    AK
    #34560

    Apologies for the delay here, I have noticed you shouldn’t need to make any further changes once 2.0.1 is released (in the coming days).

    Stephen Harris
Viewing 6 posts - 1 through 6 (of 6 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.