Support

Home Forums Event Espresso Premium How to limit user can only purchase one ticket per event at all time?

How to limit user can only purchase one ticket per event at all time?

Posted: November 17, 2020 at 7:50 pm


sebastianhsu

November 17, 2020 at 7:50 pm

Hi,

I want per logged user can only purchase one ticket per event. In the event list, once they have bought the ticket, they cannot buy any in the future. Currently in my event list, I can still buy another ticket once I have bought it. How can I do that?


Tony

  • Support Staff

November 18, 2020 at 3:26 am

Hi there,

If you are using the WP User Integration add-on you can use a snippet like this:

https://gist.github.com/Pebblo/10669adfeea322ade3d96a38857fb46b

That removes the ticket selector for an event if the user has already registered onto it leaving a message stating they have a registration already.

You can add that a custom functions plugin on the site and we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


sebastianhsu

November 19, 2020 at 1:13 am

Hi Tony,

Thanks for your reply. I add the snippet to the child theme’s function.php. Please check the link below.
https://prnt.sc/vlzgnl

However, event “student02” has been approved for this event.
https://prnt.sc/vlzk60

I can still see the selector in frontend.
https://prnt.sc/vlzl1b

Can you please help check anything I did wrong?


Tony

  • Support Staff

November 19, 2020 at 2:50 am

Did you add that registration with the WP User integration add-on enabled?

If so, were you logged into the account and used the same details as the WP User account you were logged into to register onto the event?


sebastianhsu

November 19, 2020 at 3:02 am

Hi Tony,

Ok, now I know what ticket selector is, and the ticket selector is removed from the event when I use this snippet.

Let me address my original requirement more specifically.
I am using LearnDash, and I want to create online events for specific course.
I need to show the event in the course page, but I can only use ESPRESSO_TICKET_SELECTOR short code to show related event in the course.

Therefore, what I need is, a course can have an event related to it, user can enroll the particular datetime they want. However, the frontend needs to show what datetimes they have enrolled. How can I do that?


Tony

  • Support Staff

November 19, 2020 at 7:51 am

The only output we have to show users their registrations is the ESPRESSO_MY_EVENTS shortcode with the WP User integration add-on, see here:

https://eventespresso.com/wiki/wp-user-integration/#ee4-my-events

Is that what you are looking for?

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 1 week, 6 days ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!