Hide Quantity of tickets

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

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

    Hi Stephen.

    Is there a way to hide the quantity and default it to one ?

    I have limited my tickets to one per user but it gives the user a selection on quantity and they can choose say 5. even though it wont allow the booking its confusing for the users.

    is there a way to just have it at 1 and not allow a choice ?

    Thanks

    Jody Brown
    #11997

    I’ve already made this change on your site for you, but for the benefit of others you can do this by editing templates/eo-ticket-picker.php (after moving it into the root of your theme).

    You can change it to a radio selection by replacing in that file

    <td class="eo-booking-ticket-qty">
        <?php  $value = ( isset( $input['tickets'][$ticket_id] ) ? $input['tickets'][$ticket_id] : 0 ); ?>
        <input type="number"
            class="<?php echo esc_attr( $this->element->get_class() );?>" 
            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>

    with

    <td class="eo-booking-ticket-qty">
        <input type="radio"
            class="<?php echo esc_attr( $this->element->get_class() );?>" 
            data-eo-ticket-qty="<?php echo esc_attr( $ticket_id );?>" 
            name="eventorganiser[booking][tickets]" 
            value="1" />
    </td>

    or a checkbox selection by replacing it with

    <td class="eo-booking-ticket-qty">
        <input type="checkbox"
            class="<?php echo esc_attr( $this->element->get_class() );?>" 
            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="1" />
    </td>
    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.