Support

Home Forums Event Espresso Premium Table view datetime grouping and order

Table view datetime grouping and order

Posted: October 29, 2016 at 7:39 am


jbrandligt2

October 29, 2016 at 7:39 am

Hi there,

My event tickets span multiple datetimes. Therefore it would be great if I could show the ticket name and price too and then the datetimes belonging to the specific ticket ordered by the 1st datetime. Like so:

Event A | Ticket 1 | Price | Datetime 1 | Register button
Datetime 2
Datetime 3
Event A | Ticket 2 | Price | Datetime 1 | Register button
Datetime 2
Datetime 3
Event B | Ticket 1 | Price | Datetime 1 | Register button
Datetime 2
Datetime 3

For this I would need to get the ticket information (name and price) in the loop. And after that pull the datetimes belonging to the ticket. Could you point me in the right direction on how to achieve this?

If this is not possible, one other option would be to display the datetimes of the event in the same order I arranged them in the admin interface. This way at least I can make sure the datetimes belonging to a specific ticket would be grouped together.

Jeroen


Tony

  • Support Staff

November 1, 2016 at 5:36 pm

Hi there,

The currently Table View template is based on the datetimes of an event. It loops through each event, pulls the datetimes for each event and then outputs the details for the event and its datetime(s).

As you mentioned above, your request would need to completely change how this works as you would need to loop over each event, pull all of the events tickets, loop over each ticket and output the datetimes assign to each ticket within an event.

In short you need a new custom template which is not something we can provide on the forums although we can help point you in the right direction if you would like to investigate further.

You can use the EE Model system to pull in the information you need:

https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System

Within the template loop you have the EE_Event object within $event, you can using something like Kint Dubgger to view all of the available methods on that object, for example:

d($event);

Would show everything you can call on that object which allows you to narrow down the methods you would use to pull the details you need.

If this is not possible, one other option would be to display the datetimes of the event in the same order I arranged them in the admin interface. This way at least I can make sure the datetimes belonging to a specific ticket would be grouped together.

Right now the datetimes are ordered by start date and time using:

$datetimes = EEM_Datetime::instance()->get_datetimes_for_event_ordered_by_start_time( $post->ID, $show_expired, false, $datetime_limit );

You could use the get_datetimes_for_event_ordered_by_DTT_order() method to pull the datetimes in the order they are set in the admin.


jbrandligt2

November 4, 2016 at 2:32 pm

Thanks, for your reply. Sorry for the late reaction, I have had poor internet past week due to provider issues.
I understand I’m asking too much, but I think I just might be able to pull this of myself. Thanks for the pointers!

The support post ‘Table view datetime grouping and order’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  jbrandligt2 2 years, 7 months ago ago

Topic Tags

Tagged: 

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!