Posted: August 23, 2017 at 10:09 am
|
I have a ticket called Member + Guest, which is for two people. I have it set up as a ticket bundle (min 2, max 2), but I want the user to be able to select multiples of 2. For example, 2, 4, 6, etc. I found an old post with a dead link to some JQuery, so I am hoping there’s an updated way to do this. Thanks! |
|
The old support post was this one: https://eventespresso.com/topic/sell-tickets-in-multiples-of-2-etc/ |
Hi there, In order to allow more than 2, you’ll need to change the ticket’s maximum limit from 2 to something like 10, 16, or 20. Then you can add some code to your site like the following to remove the odd numbered option values:
You can add the above to a functions plugin or into your WordPress theme’s functions.php file. |
|
|
Thanks. This worked; however, I have 3 ticket types: Member ONLY Member+Guest is the one that needs to be in pairs, which is just what your code did. However, now Member ONLY and Guest ONLY show up 1,3,5,7,9 and 2,4,6,8 respectively. Any ideas? |
You’ll need to change the selector in the code, |
|
|
The page is behind a members-only site. How can I send you log-in details? Or, I could post the code snippet from the form if that would help. |
EE adds a class to the table row for each ticket that uses the ticket name – http://take.ms/wSLxz The format of that class is You can use that in the above code to be more specific:
If that doesn’t help, you can send login details using: |
|
|
That worked wonderfully with one exception. It now lists “2” as the default number instead of 0. Can this be changed? |
Of course. You’ll go into the event editor, then click on the gear icon to open the advanced ticked editor for the Member + Guest ticket, and change the Minimum Quantity field to 0 or leave it blank. Then you update the event to save the change. |
|
|
Ok, I got it. I updated the minimum to 0, but it then showed 1,3,5,7. So, to resolve this I changed the code to:
Instead of removing the EVEN’s, I had to remove the ODD’s. Counterintuitive, but worked. |
You’ll note why it’s counterintuitive (it’s 0-based indexed) in jQuery’s documentation for the :odd selector: |
|
The support post ‘Select Tickets in Multiples of 2’ 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.