Posted: July 20, 2022 at 12:11 pm
With EE3 and MER, we have used some javascript code you provided for a number of years to enforce a prerequisite ticket within a single event (like one adult before a child’s ticket). I’ve customized that code to enforce initial limits within an event (like one booth but multiple tables and chairs). The situation now is we have a contest with multiple classes (each as an individual ticket) but we need to limit entries to one per class. That works with your code at initial form load, but once one of the classes is selected, all the other classes/tickets now have all the other quantities available again. Is there some way to enforce that individual ticket limit throughout the shopping cart process? Here’s the code I’m currently using: }); |
|
Hi there, I am Joao from the Event Espresso support team. I apologize you are facing an issue with the Event Espresso 3. I will forward your request to my teammate that will assist you as soon as possible. |
|
Hi Mike, Could you link me to the Event in question so I can see what is happening? You can mark your reply private so only EE staff can view it if needed. |
|
This reply has been marked as private. | |
Ok, so what is happening here is EE3 has a feature to update the dropdowns based on the number of spaces available taking into account the current ticket selection. I cant see a way to work around that other than to edit the file to disable the function (which isn’t really advisable but will get you out of a pinch). If you are comfortable with FTP you can go to:
Open the file and lines 247 – 251 should be something like this:
Add
How hard fresh your browser and test again. Does it work then? |
|
Tony, thanks for sharing this solution. Yes, this does work. It does, of course, impact all events and we will have some other events open at the same time. I see that this section of code is part of an IF statement starting at line 224. Expanding the condition to include my two special events, like
seems to work as well. Any unforeseen complications doing it this way? Any better way to write this expanded condition? |
|
Hi Mike! Thanks for getting back to us. Yes, your code should work fine as well. It’s up to you to choose Tony’s code and yours. We’re glad it worked! |
|
The support post ‘Limiting quantity of all tickets within an event’ 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.