add_action( 'AHEE__thank_you_page_overview_template__bottom', 'ee_add_go_back_button_to_thank_you_page' );
function ee_add_go_back_button_to_thank_you_page($transaction) {
$primary_registrant = $transaction->primary_registration();
echo "
<div class=\"jst-rght\">
<a class=\"ee-button ee-roundish indented-text big-text\"
href=\"".get_post_permalink($primary_registrant->event()->ID())."\">Go back to the ".get_the_title($primary_registrant->event()->ID())."</a>
</div>
";
}
I have to add the same button to the Registration Checkout Page, but i couldn’t find the right action/filter, i have tried with AHEE__SPCO_after_reg_step_form (found at https://eventespresso.com/wiki/ee4-single-page-checkout-page-actions-filters/), but it doesn’t do what i need: i can’t reach the event ID to build the link.
Any suggestions?
You do need to use the ‘AHEE__SPCO__after_registration_steps’ hook, however you’ll need to pull in the EE transaction separately as it is not passed to the hook.
Something like this:
function ee_display_return_to_event_on_spco(){
$checkout = EE_Registry::instance()->SSN->checkout();
if ( $checkout instanceof EE_Checkout ) {
$transaction = $checkout->transaction;
if ( $transaction instanceof EE_Transaction ) {
$primary_registrant = $transaction->primary_registration();
echo "
<div class=\"jst-rght\">
<a class=\"ee-button ee-roundish indented-text big-text\"
href=\"".get_post_permalink($primary_registrant->event()->ID())."\">Go back to the ".get_the_title($primary_registrant->event()->ID())."</a>
</div>
";
}
}
}
add_action( 'AHEE__SPCO__after_registration_steps', 'ee_display_return_to_event_on_spco' );
The support post ‘Add a go back bottom on Registration Checkout 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.
Support forum for Event Espresso 3 and Event Espresso 4.