Limit RSVP to 2 per person.

Home Forums Ticket Products Event Tickets Plus Limit RSVP to 2 per person.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1498210
    Jeff Mars
    Participant

    Hello 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!

    #1500196
    Jennifer
    Keymaster

    Hi 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

    #1519292
    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 RSVP to 2 per person.’ is closed to new replies.