Home › Forums › Ticket Products › Event Tickets Plus › Limit Tickets in Events Tickets Plus
- This topic has 5 replies, 2 voices, and was last updated 8 years, 8 months ago by
Jennifer.
-
AuthorPosts
-
August 27, 2017 at 7:30 am #1340938
Matt
ParticipantIn 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
August 28, 2017 at 3:26 pm #1341448Jennifer
KeymasterHi 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
August 29, 2017 at 5:05 am #1341655Matt
ParticipantThanks! 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!
August 29, 2017 at 9:52 pm #1342168Jennifer
KeymasterHi 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
August 30, 2017 at 4:33 am #1342251Matt
ParticipantPerfect. Works well. Thanks!
August 30, 2017 at 10:29 pm #1342876Jennifer
KeymasterGreat! 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!
-
AuthorPosts
- The topic ‘Limit Tickets in Events Tickets Plus’ is closed to new replies.
