Created
September 18, 2015 11:35
-
-
Save Pebblo/525890c30baa7e207e4f to your computer and use it in GitHub Desktop.
Add a 'Download your tickets' button to the EE4 thank you page. The hook in use adds the button above the overview, just under the confirmation order section. You will likely need to apply your own styles, possibly a container div and apply styles to that depending on how you want this to be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
function ee_display_download_tickets( $transaction ) { | |
if ( $transaction instanceof EE_Transaction ) { | |
$primary_reg = $transaction->primary_registration(); | |
if ( $primary_reg->is_approved() ) { | |
$reg_url_link = $primary_reg->reg_url_link(); | |
$query_args = array( | |
'ee' => 'ee-txn-tickets-approved-url', | |
'token' => $reg_url_link | |
); | |
$ticket_url = add_query_arg($query_args, get_site_url()); | |
echo '<a class="ee-button ee-roundish indented-text big-text" href="' . $ticket_url .'">Download your tickets!</a>'; | |
} | |
} | |
} | |
add_action( 'AHEE__thank_you_page_overview_template__content', 'ee_display_download_tickets'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment