Support

Home Forums Event Espresso Premium EE4 – Tickets Order By firstdatetime

EE4 – Tickets Order By firstdatetime

Posted: September 25, 2017 at 2:16 am

Viewing 5 reply threads


JacquesMivi

September 25, 2017 at 2:16 am

Hello,

How can I have the list of tickets order by their first datetime ? Can I use this code ?

$tickets = $event->tickets( array( array(), ‘default_where_conditions’ => ‘none’ ) );

Or should I pass by EEM_Datetime function ?

Thanks a lot,


Tony

  • Support Staff

September 26, 2017 at 10:46 am

Hi there,

Can you provide more details on what you mean by a tickets ‘first datetime’?


JacquesMivi

September 27, 2017 at 3:59 am

Suppose we are the 27/09/17. I wish a code to have this list

Ticket 1 – His first datetime is the 01/09/17
Ticket 2 – His first datetime is the 02/09/17
Ticket 3 – His first datetime is the 28/09/17
Ticket 4 – His first datetime is the 10/11/17
Ticket 5 – His first datetime is the 01/02/18

Event is the “Ticket_Order” is different.
Is it possible ?


Josh

  • Support Staff

September 28, 2017 at 1:15 pm

Hi Jacques,

The ticket ordering feature built in to EE4 allows for drag and drop reordering of the tickets. It does not automatically order the tickets by related datetime(s). One thing to keep in mind is one ticket can be related to many datetimes, so if you’re going to customize this with custom code you may need to decide whether to grab the first related datetime or the last related datetime.


JacquesMivi

October 1, 2017 at 4:43 am

Hello,

As the ordering feature does not allow this, can I use a function to have this kind of list on my custom code ? And after that, its up to me to assign the corresponding TKT_Order for each ticket.


Tony

  • Support Staff

October 2, 2017 at 5:19 am

We need more information on what you’re trying to do (not just the outcome you want from above) to be able to advise further.

As Josh mentioned, tickets can be related to multiple datetimes so even if we provide an example of how to pull the datetimes for the ticket, it depends on how you tickets are setup, which datetime you want to pull and based on what? In other words there multiple variables at play and we don’t know enough to say which will be used.

For example:

And after that, its up to me to assign the corresponding TKT_Order for each ticket.

Why are you using TKT_Order? Are you going to manually set the datetime order and then pull the datetime based on TKT_Order, then what about multiple tickets assigned to the same datetimes?

Can you let us know what you’re actually trying to do ticket tickets/datetimes and how they are setup?

Viewing 5 reply threads

The support post ‘EE4 – Tickets Order By firstdatetime’ 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