Support

Home Forums Event Espresso Premium Custom Ticket Selector Not Working

Custom Ticket Selector Not Working

Posted: November 8, 2019 at 8:07 pm

Viewing 2 reply threads


rmazook4

November 8, 2019 at 8:07 pm

I’ve created a custom single_espresso-events.php page and for some reason no matter which event I add a ticket to, the view cart page and registration page is loading the same event. I’ve narrowed the problem down to the hidden input field of tkt-slctr-ticket-id-2447[] and it’s value. How does that field determine it’s value? If I can figure out what php to put in there, I can likely fix my problem.


rmazook4

November 8, 2019 at 9:49 pm

I got it with this:

if ( $post->EE_Event instanceof EE_Event ) { $ticket_array = $post->EE_Event->first_datetime()->tickets(); $the_ticket = array_shift($ticket_array); echo $the_ticket->ID();}

Now all I need is the var for tkt-slctr-max-atndz and I should be good to go! If there’s an easier way to do this, please let me know.


Tony

  • Support Staff

November 11, 2019 at 5:36 am

Hi there,

If you ever have more than a single ticket on an event the above may not work, the value of the above is the ID of the ticket as you’ve found, so if you may more than one you need multiple inputs.

maz-atndz you can get from the event $event->additional_limit();

I recommend you take a look at how the ticket selector generates these inputs, starting with:

\event-espresso-core-reg\modules\ticket_selector\TicketSelector.php
\event-espresso-core-reg\modules\ticket_selector\TicketSelectorRowStandard.php

Viewing 2 reply threads

The support post ‘Custom Ticket Selector Not Working’ 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