Support

Home Forums Event Espresso Premium Unique Ticket ID's?

Unique Ticket ID's?

Posted: September 26, 2019 at 7:22 am

Viewing 7 reply threads


Peyton Earey

September 26, 2019 at 7:22 am

I have 6 different tickets for an event.
3 are “2Day” and 3 are “3 Day”.
I’m trying to add an extra step of “Choose 2 or 3 day” before you see all the tiers. I’ll likely do this with some JavaScript to hide each tiers until they choose.

I see that tickets have unique ID’s; something I can target. But those ID’s don’t seem to come through the front end in the table body classes. Only a sanitized slug of the ticket name.

Is there anyway to group them or have the unique ID’s come through so I can do what I’m trying to do? A better way, perhaps?


Josh

  • Support Staff

September 26, 2019 at 7:50 am

Hi,

There’s actually a built-in “Filter by date” feature that does something similar. When it’s activated it adds additional data to the ticket selector’s markup. Also, you could check its code and use it as a starting point.

The feature can be activated by going to Event Espresso > Events > Templates, then set:

Show Date & Time Filter? → Maybe show date & time filter

Date & Time Filter Threshold → 2

Date & Time Filter Max Checked → 1

Here’s a link to the source JS:
https://github.com/eventespresso/event-espresso-core/blob/master/modules/ticket_selector/assets/ticket_selector.js#L13


Peyton Earey

September 27, 2019 at 12:25 pm

Thanks.
That’s close but I have 1 problem:

Even though 3 are 3-day and 3 are 2-day, all start on the same date so the filter, no matter which is checked, still shows all.

Is there a similar filter that can filter by another method? Perhaps some sort of taxonomy I could create?


Josh

  • Support Staff

September 30, 2019 at 2:54 pm

Tickets aren’t custom post types and do not have taxonomies. Have you considered targeting the sanitized slug of each ticket’s name? If each ticket’s name is unique that should work.


Peyton Earey

October 1, 2019 at 12:28 pm

Getting closer.
If I use your method, how might I go about overriding the filter in terms of its button label and the populated results?

Ideally, I’d like to replace the actual date ranges in the filter to my custom label choices.


Josh

  • Support Staff

October 1, 2019 at 1:08 pm

It’d probably be better to build out your own filter, which could be similar to the built-in one.


Peyton Earey

October 2, 2019 at 8:16 am

Ok. Can I deregister yours and plop my own into our theme?
How to best override that filter?


Josh

  • Support Staff

October 2, 2019 at 8:22 am

You go to Event Espresso > Events > Templates, then set:

Show Date & Time Filter? to “Do not show date & time filter”.

Viewing 7 reply threads

The support post ‘Unique Ticket ID's?’ 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