Support

Home Forums Event Espresso Premium EE4: Add the ticket (description) to the registration confirmation page

EE4: Add the ticket (description) to the registration confirmation page

Posted: May 9, 2019 at 3:48 pm


mbeede@tracom.com

May 9, 2019 at 3:48 pm

Greetings – We use the “Available Tickets” portion of an EE event to setup the different dates and times available to choose from for an event. On the first screen (the selection screen) the user selects one of them and then proceeds to the second screen (the registration screen) to register. Upon submitting the registration, the registration confirmation page is displayed. This page shows a congratulations message and a table with the name, code, and status of the registrant/registration like this:

< Congratulations message >
Registration Details
for: <Event Name>
<Table with the name, code, and status>

Right after the “for: <Event Name>” line I would like add a new line for the ticket that was selected (i.e. the ticket name/description) so the user can see exactly which ticket they chose. I am not sure how to add this new line to the page. Can you help me out?


Tony

  • Support Staff

May 10, 2019 at 5:00 am

Hi there,

Sure we can 🙂

However, may I ask are you always limiting registrations to a single ticket?

The sections are broken down in events, tickets are related to registrations so if the user selects more than one ticket type from an event (or possibly even multiple ticket types from multiple events) what should be displayed?


mbeede@tracom.com

May 10, 2019 at 11:20 am

Yes, at this time we are limiting each user to a single ticket type and a quantity of just one. These are not “tickets” in the traditional sense (like a concert, show, etc.). They are for 1/2 day or full day training events and are registered individually, and only once.

Now back to my question – Can you help me the ticket name/description to the registration confirmation page?

Thanks in advance – Mark


mbeede@tracom.com

May 10, 2019 at 11:26 am

ALSO if it would be helpful you can go to this test website URL and see what I have setup for this:

Go to https://tracomevents.wpengine.com/sessions/cert-virt-social-style
See how the “tickets” are really session choices (by date/time)
Select one, then select the Register Now button
Fill out the required fields including checking the 2 boxes at the bottom
Select the Submit Registration button
This displays the Registration Confirmation screen
I want to add the ticket name/description right below the event line


Tony

  • Support Staff

May 13, 2019 at 6:36 am

There’s no hook for the specific location you are trying to add the details to, however, you can override the template used for that section to add whatever you prefer.

You’ll need to copy the template into your theme’s root directory, preferably using a child theme. If you are not using a child theme you can find details on how to create one here:

https://developer.wordpress.org/themes/advanced-topics/child-themes/

Then copy the template file:

/event-espresso-core-reg/shortcodes/espresso_thank_you/templates/thank-you-page-registration-details.template.php

Then on line 28-31 is a H5 with the ‘For {event name}’ output.

Just below that add the code to output whatever you prefer.

For the ticket description you can do something like:

$ticket = $registration->ticket();
if($ticket instanceof EE_Ticket) {
    echo '<p>';
    echo $ticket->description();
    echo '</p>';
}

$ticket should be an instance of EE_Ticket, so you can use our model system to pull whatever details you need from that:

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


mbeede@tracom.com

May 13, 2019 at 12:20 pm

Tony – So I have a child theme BUT I prefer to put all EE modifications into a custom plugin that I wrote instead. So I am not sure how to use my plugin to make sure that the customized version of ‘thank-you-page-registration-details.template.php’ is used instead of the EE standard version of that file. I am guessing I need to add a filter for it, but I don’t see any examples of doing this out on the internet or in your support forum. Can you show me what I would need to do for this?


Tony

  • Support Staff

May 13, 2019 at 4:19 pm

You’d need to use the FHEE__EEH_Template__locate_template__full_template_paths filter, which is passed an array of paths (including the filename) for EE to check for the template and the filename itself.

For example:

https://gist.github.com/Pebblo/fbbb48d358567363a3d9e0dca54b7f94

The support post ‘EE4: Add the ticket (description) to the registration confirmation page’ 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