Home › Forums › Ticket Products › Event Tickets Plus › limit the number of tickets on RSVP
- This topic has 3 replies, 2 voices, and was last updated 8 years, 5 months ago by
Nancy Hernandez.
-
AuthorPosts
-
October 24, 2017 at 6:22 am #1368012
Nancy Hernandez
ParticipantI 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
-
This topic was modified 8 years, 6 months ago by
Nancy Hernandez.
October 24, 2017 at 11:09 pm #1368480Geoff B.
MemberGood 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.November 15, 2017 at 8:35 am #1383608Support Droid
KeymasterHey 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 -
This topic was modified 8 years, 6 months ago by
-
AuthorPosts
- The topic ‘limit the number of tickets on RSVP’ is closed to new replies.
