Skip to content

Instantly share code, notes, and snippets.

@Apina
Last active August 29, 2015 14:11
Show Gist options
  • Save Apina/c0e434c177b962b73bd7 to your computer and use it in GitHub Desktop.
Save Apina/c0e434c177b962b73bd7 to your computer and use it in GitHub Desktop.
Filter Congratulations text based off gateway type.
//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