Created
August 22, 2023 13:20
-
-
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
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 | |
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