Posted: July 28, 2014 at 11:12 am
|
I have a version of ticket_selector_chart.template.php in my theme folder. Tickets with status == expired are not displayed… which works great! … But as I’m now getting tickets which are status == “sold out” it is now displaying sold out tickets that have expired. I’m fine with sold out tickets for furute events displaying, just not ones in the past. Is there a way to check if a sold out ticket has expired? is there a function similar to $ticket->ticket_status(); I can use to test the end date? |
Hi Paul, Would hiding a sold out ticket work for you? — |
|
|
Hi Lorenzo, No, unfortunately that’s not the preferred option. All expired tickets should not be displayed as I using EE4 for 6 and 8 week courses with lots of datetimes and tickets. Here’s a page with the issue I’m having… I don’t want to show last week’s class… http://www.pregnancyclasses.ie/events/pregnancy-yogalates-thursday-afternoon-july-2014/ |
|
I should add … if the class is not sold out then the ticket status is “expired” and doesn’t display, It’s only an issue for classes that have been fully booked. As this page does… |
|
Sorry forgot link … |
So you would like to remove the week 1 class? Are you wanting to remove anything else on that page? Could you also share another event that is structured in a similar manner? — |
|
|
Yes and the “Book Full Course” as that is no longer available after the first class commences. I’m not looking for a css solution here. I’m just hoping I can add a conditional line to test the “end date” in the switch |
|
Hi Paul, Hopefully I have understood your question here. To clarify, you want expired tickets to not show and fully booked tickets that have expired to also not show, while making sure normal tickets and fully booked (in the future) tickets still show? If that’s correct my solution would be this: https://gist.github.com/Apina/3877630a7d58cc4c3569
|
|
Hi Dean, Brilliant! Thanks (yet again) for a great solution. I applied it a little differently as I’m also not displaying pending tickets. For all tickets I don’t want displayed I set $status_class = ”; within the switch block. Then test if(!$status_class = ”) at the start of the next section where the tickets are displayed. So it was neater for me to place $cur_date = strtotime(date(‘Y-m-d H:i:s’)); //current date inside
Works perfectly. Thanks again! |
|
No problem and thanks for sharing your solution. I will mark this thread as resolved. If you want to take this further, please start a new forum thread and reference this one. Thanks! |
The support post ‘EE4 Ticket Status: "sold_out" overrides "expired"’ 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.