limit the number of tickets on RSVP

Home Forums Ticket Products Event Tickets Plus limit the number of tickets on RSVP

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1368012
    Nancy Hernandez
    Participant

    I have seen a few people ask about this, and i believe I have discovered a way to fix this without a plugin.

    To modify RSVP tickets default and max quantities you’ll need to create a template override for the RSVP tickets form.

    The file is located at:

    wp-content/plugins/event-tickets/src/views/tickets/rsvp.php

    Copy it over to:

    wp-content/themes/your-theme-child/tribe-events/tickets/rsvp.php

    Once the copy is in place,

    Go to line 75 to 86, where you’ll see the following:
    75 <tr>
    76 <td class=”tribe-ticket quantity” data-product-id=”<?php echo esc_attr( $ticket->ID ); ?>”>
    77 <input type=”hidden” name=”product_id[]” value=”<?php echo absint( $ticket->ID ); ?>”>
    78 <?php if ( $is_there_any_product_to_sell ) : ?>
    79 <input
    80 type=”number”
    81 class=”tribe-ticket-quantity”
    82 min=”0″
    83 max=”<?php echo esc_attr( $ticket->remaining() ); ?>”
    84 name=”quantity_<?php echo absint( $ticket->ID ); ?>”
    85 value=”0″
    86 <?php disabled( $must_login ); ?>

    On line 83 just add the limit you wish for your RSVPs, like this
    max=”2″<?php echo esc_attr( $ticket->remaining() ); ?>”

    I’d like the admin here to test this on their end and confirm that it works for them as it has for me.

    -Nancy Hernandez

    #1368480
    Geoff B.
    Member

    Good evening Nancy and welcome back!

    Thank you for reaching out to us and sharing your code.

    As it turns out, we already have a snippet for this.

    You could apply the following snippet in the functions.php file of your theme (without the PHP tag at the top): https://gist.github.com/GeoffEW/075787fd6b427e1c47be0d756ca5b26c

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1383608
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘limit the number of tickets on RSVP’ is closed to new replies.