Support

Home Forums Event Espresso Premium Get venue information on Thank You screen

Get venue information on Thank You screen

Posted: April 18, 2024 at 6:10 am


Gorkem

April 18, 2024 at 6:10 am

I’m trying to add some custom code to the Thank You screen, but i’m struggling to find a way to get the data i need.

At the end of a booking, i’m using a custom page-thank-you.php page which has:
<?php echo do_shortcode('[ESPRESSO_THANK_YOU]'); ?>
included to output the thankyou message and the usual details and links.

What i would like to be able to do is also gather some information about the booked event(s) so i can add some pertinent information.

Specifically i’d like to be able to detect the Event Venue values of the booked events so i can show some information relevant to the particular venue(s) taht have been booked.

Is there a function or hook of some kind i can use to grab those details here?


Tony

  • Support Staff

April 18, 2024 at 1:25 pm

Hi there,

We have a bunch of hooks running on the thank you page output, it depends on where you want to output the data:

### Filters:

* FHEE__payment_overview_template__no_payments_made
* FHEE__payment_overview_template__no_payment_required
* FHEE__thank_you_page_overview_template__order_conf_desc
* FHEE__thank_you_page_overview_template__order_conf_button_text

### Actions:

* AHEE__thank_you_page_overview_template__top
* AHEE__thank_you_page_overview_template__content
* AHEE__thank_you_page_overview_template__bottom
* AHEE__thank_you_page_payment_details_template__after_heading
* AHEE__thank_you_page_payment_details_template__no_payments_made
* AHEE__thank_you_page_payment_details_template__after_gateway_content
* AHEE__thank_you_page_payment_details_template__after_payment_details
* AHEE__thank_you_page_payment_details_template__after_each_payment
* AHEE__thank_you_page_registration_details_template__after_heading
* AHEE__thank_you_page_transaction_details_template__after_transaction_table_row
* AHEE__thank_you_page_transaction_details_template__after_transaction_details

The majority of those action hooks are passed the EE_Transaction object, for example

do_action('AHEE__thank_you_page_overview_template__content', $transaction);

Use the transaction object to pull in the registrations:

$registrations = $transaction->registrations();

From there you’ll have an array of EE_Registration objects. Every registration could be from a different event if using Multi Event Registration, so what you do from that point depends on your specific use case but that should get you most of the way.

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso