Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // do not copy this line
- /**
- * Removes the payment instructions from the COD payment gateway in WooCommerce.
- */
- function jp_custom_remove_instructions(){
- if ( ! class_exists( 'WC_Payment_Gateways' ) ) {
- return;
- }
- $gateways = WC_Payment_Gateways::instance(); // gateway instance
- $available_gateways = $gateways->get_available_payment_gateways();
- if ( isset( $available_gateways['cod'] ) ) {
- remove_action( 'woocommerce_email_before_order_table', array( $available_gateways['cod'], 'email_instructions' ), 10, 3 );
- }
- }
- add_action( 'woocommerce_email_before_order_table', 'jp_custom_remove_instructions', 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement