Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created August 22, 2023 13:20
Show Gist options
  • Save Pebblo/41af7900443a7894076c90cfaa4777a3 to your computer and use it in GitHub Desktop.
Save Pebblo/41af7900443a7894076c90cfaa4777a3 to your computer and use it in GitHub Desktop.
Example of how to filter the thank you page text based on the select payment method used on the EE_Transaction
<?php
add_action('AHEE__thank_you_page_overview_template__top', 'tw_filter_thank_you_text_based_on_pm');
function tw_filter_thank_you_text_based_on_pm($transaction) {
$payment_method = $transaction->payment_method();
if($payment_method instanceof EE_Payment_Method) {
if($payment_method->type() == 'Invoice') {
add_filter('FHEE__thank_you_page_overview_template__order_conf_desc', 'tw_filter_thank_you_text_for_invoice');
}
}
}
function tw_filter_thank_you_text_for_invoice($original_text) {
// This filter is call if $event_type is true above.
return 'This is some custom text set if there is a custom value';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment