Limit one ticket per person

This topic contains 18 replies, has 5 voices, and was last updated by  Stephen Harris 10 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #6156

    Hi there

    Sorry if this has been asked before – I want to create an event with 20 max attendees which each user can only buy one ticket each – is this possible?

    Also I’d like to create a free to book event – is it possible to hide the cost box?

    Thanks

    Dan

    Dan T
    #6157

    Hi Dan,

    I think I emailed someone about this – I’ll dig that code up and write a tutorial.

    As for hiding the amount – no not yet. I’m about to release 1.2, and 1.3 will focus on the booking form in which it’ll be a lot more flexible to do things like that. (although you could just hide it with some CSS).

    Stephen Harris
    #9162

    Stephen,

    Is there any update related to being able to limit ticket purchases to one per person?

    Regards,

    JB

    JB Woodruff
    #9166

    Yes, I would also like to have that option.

    Gabriel Beauchamp
    #9167

    There is the ‘Simple Booking Mode’ (see http://wp-event-organiser.com/blog/announcements/version-1-4-what-to-expect/#simple-booking-mode). Currently it is only possible when for non-recurring events, unless you are selling ‘by series’.

    Stephen Harris
    #9168

    Thank you Stephen. I’ll see if this meets my client’s needs.

    JB Woodruff
    #9169

    Not really what I need. I am looking to have multiple ticket options, but you can only buy 1 ticket… Like a radio button option.

    Gabriel Beauchamp
    #9170

    @Gabriel You can do that too. Edit the template eo-ticket-picker.php in event-organiser-pro/templates (copy to your theme first). And change the type of the booking quantity field (~line 77) from ‘number’ to radio and set the value to 1. Of course that’s not foolproof in that, for example, someone could edit the mark-up in their browser and change the quantity from 1. You can prevent that by following the second part of this tutorial: http://wp-event-organiser.com/blog/tutorial/limit-bookings-to-one-ticket/. (The tutorial itself is about ensuring a user can only ever make one booking for an event, and that it can only contain one ticket – so you only need part of it).

    Stephen Harris
    #9171

    Here is my scenario.

    I teach dance classes.

    I want to be able to have my students register for classes.

    There is a limit of 10 guys and 10 girls.

    So 10 tickets for guys and 10 tickets for girls.

    When the user registers, they need to select their ticket, but be able to purchase more than 1 since it does not make sense in this scenario.

    You think you can help me out?

    Thanks,

    Gabriel Beauchamp
    #9172

    I was typing at the same time as your answer.. I will try that.

    Gabriel Beauchamp
    #9173

    Thanks! That works nicely for me! 🙂

    Gabriel Beauchamp
    #9183

    In your example below:
    http://wp-event-organiser.com/blog/tutorial/limit-bookings-to-one-ticket/

    Where exactly should we add these functions?

    Gabriel Beauchamp
    #9207

    Ideally in a separate plug-in (which you create), but it can go in your theme’s functions.php.

    Stephen Harris
    #10043

    I´ve tried to change “number” to “radio” and “0” to “1” in the “eo-ticket-picker.php” but I can’t make it work.

    Is this what I´m supposed to change?
    <td class=”eo-booking-ticket-qty”>
    <?php $value = ( isset( $input[‘tickets’][$ticket_id] ) ? $input[‘tickets’][$ticket d] : 0 ); ?>
    <input type=”number” data-eo-ticket-qty=”<?php echo esc_attr( $ticket_id );?>” name=”eventorganiser[booking][tickets][<?php echo esc_attr( $ticket_id );?>]” max=”<?php echo $spaces; ?>” style=”width:auto;” min=”0″ value=”<?php echo esc_attr( $value );?>” />
    </td>

    to

    <td class=”eo-booking-ticket-qty”>
    <?php $value = ( isset( $input[‘tickets’][$ticket_id] ) ? $input[‘tickets’][$ticket_d] : 1 ); ?>
    <input type=”radio” data-eo-ticket-qty=”<?php echo esc_attr( $ticket_id );?>” name=”eventorganiser[booking][tickets][<?php echo esc_attr( $ticket_id );?>]” max=”<?php echo $spaces; ?>” style=”width:auto;” min=”0″ value=”<?php echo esc_attr( $value );?>” />
    </td>

    Urban Norlander
    #10052

    Hi Urban,

    The following is the correct mark-up for using radio boxes.

     <td class="eo-booking-ticket-qty">
          <?php $checked =  ( !empty( $input['tickets'] ) && $input['tickets'] == $ticket_id ); ?>
          <input type="radio" data-eo-ticket-qty="<?php echo esc_attr( $ticket_id );?>" name="eventorganiser[booking][tickets]" <?php checked( $checked ); ?> value="<?php echo esc_attr( $ticket_id );?>" />
     </td>

    However, there is a bug in the booking form javascript – and a fix shall be released shortly.

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