Below is a list of filter hooks that are available in the WP Express Checkout plugin.
Table of Contents
Thank You Page Related
wpec_thank_you_message
This filter allows you to modify the output data on the “Thank you” page. This can be used to add some additional details or HTML code to the thank you page message shown by this plugin after a transaction.
Below is an example of how to use this filter:
add_filter('wpec_thank_you_message','my_custom_thank_you');
function my_custom_thank_you( $content ){
//Adding an example link to the thank you message.
$content .= '<a href"https://example.com/info">More Info</a>';
return $content;
}
PayPal SDK Parameter Related
wpec_paypal_sdk_args
This filter hook executes before the PayPal SDK is loaded for the payment button generation. This can be used to tweak some PayPal SDK related arguments.
Below is an example of how to use this filter hook. This will hide the sofort, mybank, sepa funding options.
function my_custom_paypal_sdk_args( $args ) {
// See the following documentation for all method names
// https://developer.paypal.com/docs/checkout/reference/customize-sdk/#disable-funding
$args['disable-funding'] = 'mybank,sofort,sepa';
return $args;
}
add_filter( 'wpec_paypal_sdk_args', 'my_custom_paypal_sdk_args' );
Payment Popup Form Related
wpec_payment_form_custom_amount
This filter allows you to modify the custom amount value on the “Payment Popup” overlay window. This can be used to override the custom amount value.
Below is an example of how to use this filter hook:
add_filter('wpec_payment_form_custom_amount','my_custom_amt', 10, 2);
function my_custom_amt( $custom_amt, $product_id){
//Read the custom amount from the query parameter and use it
$custom_amt = isset($_REQUEST['custom-amount']) ? $_REQUEST['custom-amount'] : $custom_amt;
return $custom_amt;
}
wpec_payment_form_custom_quantity
This filter allows you to modify the custom quantity value on the “Payment Popup” overlay window. This can be used to override the custom quantity value.
Below is an example of how to use this filter hook:
add_filter('wpec_payment_form_custom_quantity','my_custom_qty', 10, 2);
function my_custom_amt( $quantity, $product_id){
//Read the custom quantity from the query parameter and use it
$quantity= isset($_REQUEST['custom-qty']) ? $_REQUEST['custom-qty'] : $quantity;
return $quantity;
}