Support

Home Forums Event Espresso Premium Customizing what tickets are fetched for Ticket Selector

Customizing what tickets are fetched for Ticket Selector

Posted: October 23, 2015 at 12:57 pm


Hideout Theatre

October 23, 2015 at 12:57 pm

I am customizing EE to sell tickets to recurring weekly events. I create a Datetime instance for each week’s show, and then I create a ticket named for the date for each Datetime.

Because we sell tickets in person at the box office, I cut off online sales 30 minutes before show time. I would still like the Ticket Selector to show tickets that are no longer available for purchase online, so customers are aware of the show time.

Is there a supported way to customize/change how the $tickets variable is populated for the ticket_selector_chart code? A function I can redefine in my child theme or my site plugin code maybe?


Hideout Theatre

October 23, 2015 at 1:24 pm

I guess really what I’d like to be able to do is show all tickets (expired or not) for all Datetimes that are in the future. Is that possible?

If I enable Display Expired Tickets, it shows me all tickets, even for past events.

I see that the Ticket Selector module has a file EED_Ticket_Selector.module.php where there is a function display_ticket_selector() which does the fetching of the tickets. Is there a way to over-write that function in a template, theme, or site plugin?


Josh

  • Support Staff

October 23, 2015 at 7:48 pm

There is a way to unhook the entire display_ticket_selector() method, by unhooking it from the AHEE_event_details_header_bottom action hook.

Before you go and rewrite the function though, I can recommend taking a look at the FHEE__ticket_selector_chart_template__do_ticket_entire_row filter hook (you’ll find this in ticket_selector_chart.template.php). This filter can be used to switch off (or on) the display of specific rows.


Hideout Theatre

October 23, 2015 at 8:44 pm

I think I would rather re-write the function, as our shows repeat weekly ad-infinitum, and I would hate to fetch an increasing number of rows from the datbaase just to hide them in the view. That seems wasteful.

Will unhooking the display_ticket_selection() method from the AHEE_event_details_header_bottom action hook apply to the ticket selector shortcode as well, or only the single event view? It seems like using the shortcode and modifying the ticket selector view is the easiest way to roll EE into my existing site.

If there are examples of unhooking this method somewhere, can you link me to it? I’d much rather do this the correct way than overwrite core code.


Josh

  • Support Staff

October 26, 2015 at 9:21 am

I’m not aware of any examples that show how to unhook this specific method, you use the remove_action function like you would with any other action.

The support post ‘Customizing what tickets are fetched for Ticket Selector’ 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