Limit Tickets in Events Tickets Plus

Home Forums Ticket Products Event Tickets Plus Limit Tickets in Events Tickets Plus

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1340938
    Matt
    Participant

    In Events Tickets Pro, I am looking to limit the number of paid tickets per person to two. I looked at the previous php code provided (limit_tckt_qty.php) but found that it does not work for paid tickets (only RSVPs). Is there another code which I can use? Would this also prevent a logged in user from checking out a second time with another 2 tickets to the same event? Ultimately, I want to limit each registered account to two tickets per event.

    If I were to use a third-party plug-in, which one would you recommend?

    Thanks

    #1341448
    Jennifer
    Keymaster

    Hi Matt,

    Thanks for reaching out!

    Is this the code that you are using? I made a slight modification, and this should work on tickets. However, it will not prevent a user from creating another purchase with another two tickets. Using this snippet, they can also increase the number of tickets from the cart or by coming back to the page. I believe that code was really meant as a starting point for a more robust customization.

    Are you using WooCommerce to handle checkout? If so, you can take advantage of some of the plugins that add this functionality for WooCommerce products, since that is essentially what tickets are.

    I would recommend taking a look at the following add-ons:

    Min/Max Quantities from WooCommerce

    Min and Max Purchase for WooCommerce from the wordpress.org plugin repo.

    I hope that helps! Please let me know if you have any questions.

    Thanks,

    Jennifer

    #1341655
    Matt
    Participant

    Thanks! One last question- how do I hide the ticket quantities being displayed in the list view… turning off inventory in woocommerce doesn’t seem to do it.

    I saw a previous post where adding the following to the CSS was suppose to do the trick but it didn’t work for me.

    .tribe-events-event-cost .tribe-tickets-left {
    display: none;
    }

    Thanks!

    #1342168
    Jennifer
    Keymaster

    Hi Matt,

    I did a quick test, and that CSS did work on my end. Did you add it to the Custom CSS area under Appearance > Customize (if your theme has one) or the style.css file of your child theme? If so, you can also try adding !important:

    .tribe-events-event-cost .tribe-tickets-left {
    display: none !important;
    }

    Or, you can add the following to the functions.php file of your child theme:

    function tribe_remove_tickets_remaining( $html, $event_id ) {
    if( ! tribe_events_has_soldout( $event_id ) ) {
    $html['stock'] = '';
    }
    return $html;
    }
    add_filter( 'tribe_tickets_buy_button', 'tribe_remove_tickets_remaining' );

    Let me know if that works for you!

    Thanks,

    Jennifer

    #1342251
    Matt
    Participant

    Perfect. Works well. Thanks!

    #1342876
    Jennifer
    Keymaster

    Great! I’m glad to hear it’s working now.

    I’ll go ahead and close out this thread, but please feel free to open a new one if you have any other questions!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Limit Tickets in Events Tickets Plus’ is closed to new replies.