Created
October 12, 2016 09:12
-
-
Save vanbo/6ca6e793be71ee5eabf4c33781125390 to your computer and use it in GitHub Desktop.
Remove BACS details from WooCommerce Thank You page
This file contains hidden or 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
| add_action( 'init', 'remove_bacs_from_thank_you_page', 100 ); | |
| function remove_bacs_from_thank_you_page() { | |
| // Bail, if we don't have WC function | |
| if ( ! function_exists( 'WC' ) ) { | |
| return; | |
| } | |
| // Get all available gateways | |
| $available_gateways = WC()->payment_gateways()->get_available_payment_gateways(); | |
| // Get the Bacs gateway class | |
| $gateway = isset( $available_gateways['bacs'] ) ? $available_gateways['bacs'] : false; | |
| // We won't do anything if the gateway is not available | |
| if ( false == $gateway ) { | |
| return; | |
| } | |
| // Remove the action, which places the BACS details on the thank you page | |
| remove_action( 'woocommerce_thankyou_bacs', array( $gateway, 'thankyou_page' ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment