Help Desk

Limit the number of tickets för a customer to buy

  • Topics: 1
    | Permalink

    Hi,

    Can I limit the number och tickets that a custopmer can buy? e.g. “You can buy max 5 tickets for this event”

    Regards,
    Olle Zettergren

    Posts: 6978 Topics: 2
    | Permalink

    Hi Olle,

    Thanks for reaching out! Great question!

    Limiting the number of tickets per buyer is not a built-in option.

    It might be possible with custom coding or you can try some third party plugin like these:

    For this you might need to set up your calendar to sell tickets through their WooCommerce product page only.

    Please note, customizations are beyond the scope of the support we can provide.

    Hope this helps. Let me know if you have further questions.

    Cheers,
    Andras

    Posts: 8 Topics: 2
    | Permalink

    Hello – I am seeing the field called “Purchase Limit” in the backend of the “ticket” fields. Wouldn’t this limit the number that a user could purchase?

    However, on the front end it does seem a user can enter as many as they want.

    Thanks for any clarification you can offer!

    Posts: 6978 Topics: 2
    | Permalink

    Hi robinsoncenter,

    Thanks for your question!

    Wouldn’t this limit the number that a user could purchase?

    Yes, that limits the number of tickets you can put in your cart. However that only limits the number of tickets per order. You can later go back and purchase more with the same user.

    However, on the front end it does seem a user can enter as many as they want.

    This seems to be a glitch. Although you can increase the counter higher, at the end only the max allowed number will be added to your cart.

    We have a workaround for this one until it gets fixed. Make a template override of the tickets.php template and use the following code in it:

    I hope this clarifies and helps.

    Cheers,
    Andras

    Posts: 8 Topics: 2
    | Permalink

    Thank you very much for you answers to my questions and the code snippet. I’ll give that a try!

    Posts: 8 Topics: 2
    | Permalink

    I have added that code snippet and it does help, although not quite as I was thinking. It limits the number being purchased only at the step when you choose “Add to Cart”.

    However for my ticket types, there are additional Attendee Info fields, and it allows you to add as many tickets as you want, fill out those fields and THEN it tells you the limit. This could be confusing and time consuming for the user. It seems it would be a better user experience if the number select field was just limited from the outset, based on the ticket limit capacity set in the backend of the ticket. Then if only 5 attendees are allowed, it would only offer 5 sets of Attendee info fields.

    Thanks for considering this!

    Posts: 6978 Topics: 2
    | Permalink

    Hey man,

    That is an absolutely valid point there, thanks for sharing!

    I bumped up the priority of the bugticket, so I do hope we can provide a fix for this soon. Hang in there.

    I am going to set the status of this ticket to “pending fix” and we will update it once the fix is released.

    If you have any new questions or issues please create a new ticket and we’ll help you out.

    Thanks and cheers,
    Andras

    Cheers,
    Andras

    Posts: 8 Topics: 2
    | Permalink

    Thanks for much for following up in this regard. We look forward to the update.

    Take care!

    Posts: 6978 Topics: 2
    | Permalink

    Will keep you posted.

    Cheers,
    Andras

    Posts: 8 Topics: 2
    | Permalink

    Hello again! We have recently done the available updates to all of our TEC plugins, and it now seems that the functionality to limit the number of tickets that can be added to your cart has been removed altogether? I see that you can set a number of overall tickets that can be sold, but for example if there are 40 tickets, one person could buy all 40.

    I removed the code snippet I had added above, thinking maybe there was a conflict, but that didn’t help. Or maybe that code snippet needs to be updated because of current updates?

    Do you know if this feature was purposefully removed?

    I appreciate any insight you can offer! Thank you!

    Posts: 6978 Topics: 2
    | Permalink

    Hi Olle,

    Thank you for the ping.

    I have checked what is happening and yes, this functionality has been removed from the plugin for various reasons.

    It looks like however that we might develop an extension to provide this functionality. I cannot say when that is going to happen exactly at the moment.

    If you can ping me in another 2 weeks or so I should have more information.

    Have a great weekend!
    Cheers,
    Andras

    Posts: 8 Topics: 2
    | Permalink

    Thank you very much for the clarification! It seems to me that this is a pretty necessary functionality for tickets, because if someone bought all of the tickets in one go, then the event wouldn’t really function properly. I suppose we have to hope that people behave considerately and don’t do that!

    I look forward to this addition as soon as possible!

    Posts: 6978 Topics: 2
    | Permalink

    You’re welcome!

    There are two workarounds that could help you:

    On the WooCommerce product page you can go to the Inventory tab and check ‘Sold individually’. (screenshot) This will limit the purchase to 1 ticket only in one order.

    Or you could try a plugin that limits the number of products (like this one or this one) that can be purchased. There are more like this.

    Note, I haven’t tested these plugins so cannot confirm if they work, but testing them shouldn’t be too difficult.

    Cheers,
    Andras

    Posts: 8 Topics: 2
    | Permalink

    Thank you for those suggestions! I did try to limit the sale in the WooCommerce inventory settings, however the challenge here is that the user is still allowed to “think” they are purchasing multiple tickets, but when they get to their cart, only 1 is there. Unfortunately, because we are using ticket fields, they would go to the trouble of entering the information for all 3 tickets (for example) but then only 1 would be in the cart.

    I think the user would find this confusion, or possibly not even notice that only 1 ticket had actually made it there. So I don’t think this option will work for our purposed. I think the ticket limit really has to come from the direction of the Events side of things in order to be clear and concise for the user.

    I really do appreciate the ideas though!

    Posts: 6978 Topics: 2
    | Permalink

    Thanks for getting back to me on that and sharing your thoughts.

    I have one more idea for you. Actually two.

    If you want to limit the ticket purchase to one ticket only, then go to the WooCommerce product, go to Inventory, and check the box that says ‘Sold individually’. This will then limit the ticket purchase to one ticket. Here’s a screenshot.

    If you want to limit to more (but the same for all tickets), then you can create a template override for this file:

    public/wp-content/plugins/event-tickets-plus/src/views/wootickets/tickets.php

    Line 123 is this:

    $max_quantity = $product->is_sold_individually() ? 1 : $max_quantity;

    Change it to the max quantity you want to allow, like:

    $max_quantity = 3;

    If you would like different limits to different tickets, then you could build in an “if” with the ticket ID’s like this:

    if ( $ticket->ID == 12 ) {
    $max_quantity = 5;
    }
    elseif ($ticket->ID == 16 ) {
    $max_quantity = 2;
    }
    else {
    $max_quantity = 1;
    }

    The ticket ID’s you can figure out if you hover over the pencil icon when trying to edit a ticket. (screenshot) I know this can be cumbersome with a lot of tickets, but it works. 🙂

    You could also use arrays for the ticket numbers if you are handling a lot of them. Set up different arrays of ticket ID’s for the different limits and then make a check “if the $ticket->ID is in this or that array, then do this” kinda thing.

    Hope this helps.

    Cheers,
    Andras

    Posts: 65
    | Permalink

    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

    | Permalink

The topic ‘Limit the number of tickets för a customer to buy’ is closed to new replies.