Posted: April 20, 2018 at 3:10 am
I have a follow up question to that post: I would like to use the receipt as a certificate after the event. I was able to insert most information like People, Datetimes and Post Meta into the receipt. But I can’t figure out how to display the check-in of the primary registrant (we sell only one spot per ticket so are only using the primary registrant). Is there a “helper” that I can use (like the Event_View helper)? |
|
Hi there, If you have the registration object (or have the registration ID, then get the registration object) you can use the check_in_status_for_datetime() method. Or build out a shortcode using similar PHP code. |
|
Hi Josh, that’s actually is what I have trouble with, I can’t figure out how to load the registration object. I found this https://github.com/eventespresso/event-espresso-core/blob/master/docs/T–Tutorials/customizing-the-ee-thank-you-page.md description but it shows me an error that registrations() is a member function. EE_Registry::instance()->load_model( 'Transaction' ); $transaction = EE_Registry::instance()->load_model( 'Transaction' )->get_transaction_from_reg_url_link(); $registrations = $transaction->registrations(); Could you hint me to another way how to have the registration object? |
|
You’re not actually working within the context of the Thank You page, you’re working within the context of the HTML Receipt, right? So you can get the registration object in the same manner that the Receipt’s Primary Registrant shortcodes get the registration object. You’ll find an example in the |
|
Thank you Josh, that helped me a lot. How could I load the registration object in the table template? |
|
Which table template specifically? |
|
I mean the Events Table View Template (Add-on). |
|
That particular add-on only deals with events, datetimes, and venues, so it has no use for the registration object. I can point you to the documentation that shows how to get related models (for example if you have an event, you can get the related datetimes, then get the related tickets and registrations). |
|
Thank you, that will help me also with other topics. We sell mostly two different tickets per event. I would like to display the amount of each ticket sold for the current event. Do you have an code example which I can transfer to my case? Or is there an easier way? |
|
Hi Motio, Each ticket has a sold value stored in the database, that’s the number of Approved registrations linked to that ticket. So when you have the ticket object, you can do something like As far as I am aware, we don’t have any examples of what you are looking for. |
|
Thank you Tony, step by step I get to understand everything. In case somebody has a similar task, here is a part of the code: $get_event = EEH_Event_View::get_event(); $get_tickets = $get_event instanceof EE_Event ? $get_event->tickets() : ''; // Filter tickets for a Ticket name $ticket_kursteilnahme = array_filter( $get_tickets, function ($e) { return $e->get_raw('TKT_name') == "Kursteilnahme"; } ); // Get array of all formatted ticket prices $min_price = array_map(function($o) { return $o->pretty_price(); }, $get_tickets); |
|
Thank you both for your help. I am almost ready with the certificate template and it will save me a lot of time. |
|
The support post ‘Check-In in HTML Receipt (Use of the receipt as a certificate after the event)’ 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.