• Hello!

    I hope that this one is the right sub-forum.

    I want to hide the payment instructions in all customer order mails.
    I managed to hide the payment instructions for BACS payment in the on-hold email with this code:

    add_action( ‘init’, ‘prefix_remove_bank_details’, 100 );
    function prefix_remove_bank_details() {

    // Do nothing, if WC_Payment_Gateways does not exist
    if ( ! class_exists( ‘WC_Payment_Gateways’ ) ) {
    return;
    }

    // Get the gateways instance
    $gateways = WC_Payment_Gateways::instance();

    // Get all available gateways, [id] => Object
    $available_gateways = $gateways->get_available_payment_gateways();

    if ( isset( $available_gateways[‘bacs’] ) ) {
    // If the gateway is available, remove the action hook
    remove_action( ‘woocommerce_email_before_order_table’, array( $available_gateways[‘bacs’], ’email_instructions’ ), 10, 3 );
    }
    }

    So I thought I could copy the code and replace “bacs” with “cod” and the COD payment instructions are removed from the order emails, but no luck, they are still showing up.

    To make it a bit more complicated: I don’t want to remove the payment instructions on the thank you page.

    Best regards
    Mel

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Remove COD Payment Instructions in order Emails’ is closed to new replies.