-
-
Save Pebblo/e89c629e55b24535b54f to your computer and use it in GitHub Desktop.
Snippet to display the registrations custom questions within the thank you table - http://take.ms/bp7Ba
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 | |
//Do not include the opening PHP tag if you already have one. | |
function ee_display_questions_on_thank_you_table($registration) { | |
if( count($registration->answers()) > 0 ) { | |
?> | |
<tr> | |
<th width="50%"> | |
<?php _e("Questions",'event_espresso')?> | |
</th> | |
<th width="50%" class="jst-left"> | |
<?php _e("Answers",'event_espresso');?> | |
</th> | |
</tr> | |
<?php | |
foreach ( $registration->answers() as $answer ) { | |
if ( $answer instanceof EE_Answer ) { | |
//d($answer->question()); | |
echo '<tr>'; | |
echo '<td width="50%">'; | |
if ($answer->question() instanceof EE_Question) { | |
echo $answer->question()->display_text(); | |
echo '<br>'; | |
} | |
echo '</td>'; | |
echo '<td width="50%" class="jst-left">'; | |
$answer->e_value(); | |
echo '<br>'; | |
echo '</td>'; | |
echo '</tr>'; | |
} | |
} | |
} | |
} | |
add_action( 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', 'ee_display_questions_on_thank_you_table' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment