Support

Home Forums Event Espresso Premium Annual ticket limit for users

Annual ticket limit for users

Posted: July 24, 2019 at 4:01 am

Viewing 1 reply thread


children-first

July 24, 2019 at 4:01 am

Hello everybody,

I have a question about restricting ticket orders for specific users.
EventEspresso we use for reservations and orders of tickets of a non-profit organization.

At the moment the site is not online, it is currently being built with the non-profit organization founder and me.

The website is intended for needy children and adolescents – children and adolescents who can not afford such an event.
The website offers tickets (for example for football matches sponsored by the football clubs) that partners of the charitable organization can reserve (such as a children’s home).

Since we want to provide access to such an event to as many children and adolescents as possible, we want to introduce a kind of “limit on ticket reservation”.
This is to prevent someone constantly going to an event and “stealing” the ticket to another needy.

The “Ticket-Limit” should e.g. look like this:
“children’s home A” can reserve a maximum of 50 tickets in one year (2019).
If the limit is reached, “children’s home A” should not be able to reserve tickets for this year (2019).
Only in the following year (2020) is “children’s home A” again possible to reserve tickets.

Is this possible?

Thank you in advance!


Tony

  • Support Staff

July 24, 2019 at 4:44 am

Hi there,

In short, yes its possible.

However, we don’t have anything built within Event Espresso to do it out of the box so you’re going to need custom development.

Assuming you require users to log into the site to register (I’m not sure how it would work otherwise) you could add a count of registrations to user meta as they add registrations (or, more likely as the registrations are set to Approved). So then it would be a case of hooking into EE as it processes new registrations, checking that value and either rejecting the registrations based on the current value or incrementing the value as they add more.

There are a few different ways you could do this but assuming you are a developer and comfortable with PHP you can check out the FHEE__EE_SPCO_Reg_Step_Attendee_Information___process_registrations__pre_registration_process hook

That hook is used by the WP User Integration add-on (which you have access to so could take a look at the code used there for an example) to perform a check on the details and confirm if a user already exists matching the email used, if they do and the current user is not logged in it prevents the registration and displays an error, you could do something similar based on the user_meta value (or you could even pull registrations connected to the users contact and count those directly without using user meta if preferred, that’s a little slower but possibly more accurate depending on your use case).

Or, you could do something like this: https://gist.github.com/Pebblo/10669adfeea322ade3d96a38857fb46b

Which doesn’t do what you need as it removes the ticket selector for an event if there is a single registration linked to the current contact for the event in question but you could do something and check for registrations, then remove the ticket selector completely if they have 50 or more for the year.

Viewing 1 reply thread

The support post ‘Annual ticket limit for users’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso