Home › Forums › Ticket Products › Event Tickets Plus › Limit RSVP to 2 per person.
- This topic has 0 replies, 2 voices, and was last updated 7 years, 11 months ago by
Jeff Mars.
-
AuthorPosts
-
April 5, 2018 at 6:37 pm #1498210
Jeff Mars
ParticipantHello we just purchased this license but I’m afraid it may not be possible to achieve what we need it to do even though it seems very simple.
We are sending out a mailer to RSVP to a free party – no tickets, just private invitations.
The invitees should be able to bring 1 guest only. However, there does not seem to be any way to limit this per person.
Please let me know if there is some code we can add to get this feature. Thank you!
April 8, 2018 at 11:52 pm #1500196Jennifer
KeymasterHi Jeff,
You can use this snippet to set the maximum number of RSVPs that can be submitted at once to 2:
/* Tribe, limit ticket qty */
function tribe_limit_tickets() {
?><script type="text/javascript">
jQuery(document).ready( function( $ ) {
// do this if tickets available
if ( $('.tribe-events-tickets').length ) {
// set max qty to 1
$('.tribe-events-tickets .tribe-ticket-quantity').attr('max', 2);
// run on input change
$('.tribe-events-tickets .tribe-ticket-quantity').change ( function ( ) {
// don't run the manually triggered change event
if ( $(this).val() == 0 ) return;
// make sure it's not more than 1
if ( $(this).val() > 2 ) $(this).val(2);
// change all inputs but this to 0
// manually trigger the change event so available stock gets updated
$('.tribe-events-tickets .tribe-ticket-quantity').not( $(this) ).val(0).change();
});
// add a oninput event
$('.tribe-events-tickets .tribe-ticket-quantity').on('input', function (e) {
$(this).change();
});
}
});
</script><?php
}
add_action('wp_head', 'tribe_limit_tickets');Let me know if this works for you!
Thanks,
Jennifer
April 30, 2018 at 9:35 am #1519292Support 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 -
AuthorPosts
- The topic ‘Limit RSVP to 2 per person.’ is closed to new replies.
