-
-
Save Apina/c0e434c177b962b73bd7 to your computer and use it in GitHub Desktop.
Filter Congratulations text based off gateway type.
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
//EE version as of writing is 4.4.6 - in that version the AHEE__thank_you_page_overview_template__top action does NOT | |
// have the $trasnaction array available to it, so the /wp-content/plugins/event-espresso-core-reg_446/shortcodes/espresso_thank_you/templates/thank-you-page-overview.template.php | |
//will need to be edited to add that variable in (first line of the file). | |
//the functions below should be added to a site specific Custom Functions plugin. | |
function custom_invoice_response($transaction) { | |
return "Please send this invoice with payment attached to the address above before the event (preferred) or bring a copy of the invoice and cheque to the event."; | |
} | |
function custom_bankdraft_response($transaction) { | |
return "This is a bank draft"; | |
} | |
add_action('AHEE__thank_you_page_overview_template__top', 'modify_congratulations', 10, 1); | |
function modify_congratulations($transaction) { | |
if($transaction->selected_gateway() == "Invoice") { | |
add_filter('FHEE__thank_you_page_overview_template__order_conf_desc','custom_invoice_response'); | |
} | |
//This is commented out so wont show, but is an example of how you can extend this code | |
// to apply to other gateways | |
//elseif($transaction->selected_gateway() == "Bank") { | |
//add_filter('FHEE__thank_you_page_overview_template__order_conf_desc','custom_bankdraft_response'); | |
//} | |
else { | |
//just return the Standard congratulations message | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment