Hi there
I am hoping you help with some advice...
I need to display a list of "the cheapest ticket - for each event - for each day".
The site is setup with various relationships and there are multiple conditions to filter events, tickets and venues posts.
The list is for a google sheets import and the problem is each time the google sheet runs a refresh import it times out because the list generating on a designated page on the website loads way too slowly - absolutely due to the need for multiple views within views.
I am trying to find another way to get the data...
Here is how it currently works:
RELATIONSHIPS
Tickets (woo products) are children of both Events and Venues.
PAGE
hidden link
No header, footer, title, feature image or crumb. No follow. Public. No cache.
Calls: In the body field is the CONTENT TEMPLATE shortcode.
CONTENT TEMPLATE
Calls: VIEW1
Note that inside that VIEW1 are VIEW2, VIEW3 and VIEW4.
VIEW 1
Purpose: Get all relevant 'events'
Find: all 'event' posts that have 'ticket' children - I am using a filter in functions.php to do this. See image attached.
Filter: 'ff post status' is a string equal to 1
Sort: By 'post title' ascending.
Limit: x
Calls: In the loop is VIEW2.
(( - Right now I have this view limit set to 20 otherwise the site will throw a 503 timeout - see attached image for server PHP settings - ))
VIEW 2
Purpose: Get all related and relevant 'tickets'
Find: all 'ticket'
Filter: By tickets in the 'events-tickets' relationship related to the 'event' post in the loop
Filter: 'ticket expire' is a number greater than NOW()
Filter: '_stock_status' is a string equal to 1
Filter: 'ff post status' is a string equal to 1
Sort: By 'ticket start date' ascending
Limit: x
Calls: In the loop results are grouped by 'ticket start date' - I am using a [gtxdateheading] shortcode for this. See image attached.
Calls: Inside each date group are various custom fields, VIEW3 and VIEW4.
VIEW3
Purpose: To count how many individual tickets in each date group.
Find: All 'tickets'
Filter: 'ticket start' is a number equal to VIEW_PARAM(date)
Filter: 'ff parent id' is a string equal to VIEW_PARAM(eventid)
Filter: '_stock_status' is a string equal to 1
Filter: 'ff post status' is a string equal to 1
Sort: By 'post date' descending
Limit: x
Calls: In the loop is a custom select field 'ticket bundle' prefixed with '+'. See the [calculate] shortcode in VIEW2.
Calls: I am using a 'calculate' shortcode to calculate the sum of all the raw values for each ticket.
VIEW4
Purpose: To find the cheapest ticket in each date group.
Find: All 'tickets'
Filter: 'ticket start' is a number equal to VIEW_PARAM(date)
Filter: 'ff parent id' is a string equal to VIEW_PARAM(eventid)
Filter: '_stock_status' is a string equal to 1
Filter: 'ff post status' is a string equal to 1
Sort: By 'ticket each' ascending
Limit: 1
Calls: In the loop are various fields from the ticket, the parent event and the parent venue.
--
That's it in a nutshell. This setup gives me the exact list I need.
The final list of tickets displayed is just under 500... But it loads too slow...
Do you think there is another way?
I have tried many MANY ideas to try to remove the need for so many nested views but none suffice...
Any ideas are MOST certainly welcome!
Regards
Rita