• Resolved edasjk

    (@edasjk)


    Hi,

    I need to remove bank details from new order email sent to customer.
    Currently banking details are above order details.
    I tried to look in email templates but this is a little bit too complicated for me.

    Here is part of email customer get:

    Your order is on-hold until we confirm payment has been received. Your order details are shown below for your reference:

    (NEED TO REMOVE TEXT BELOW)

    Our bank details
    I? ”Saugos ?enklai”:

    Bank: Swedbank AB
    Account number: LT48 7300 0100 0055 5293
    IBAN: LT487300010000555293

    Thanks for any advice,
    Edvard

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @edasjk,

    This will require copying the right email templates into your theme and setting up some custom logic. I say that because I assume you accept payment from other methods as well, not just BACS?

    If so, you essentially need to say with some elegant code that if the payment method is BACS then don’t include the details and instructions in the email.

    Thread Starter edasjk

    (@edasjk)

    Hi ryanr14,

    Thanks for reply.

    The reason why I need to remove bank account data from new order email:

    Sometimes there is no sufficient amount of good available in stock. Seller don’t want to make warehouse accounting in e-shop.

    So seller confirms order and sends invoice to customer. Only then customer can pay for products.

    I hhink situation is better explained now.

    I need just remove one or two strings from template.

    Edvard

    Thread Starter edasjk

    (@edasjk)

    I find solution here:
    https://www.vanbodevelops.com/tutorials/remove-bank-details-from-woocommerce-order-emails

    I pasted this code into themes/themename/functions.php

    // Remove the original bank details
    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 );
    	}
    }
    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @edasjk Glad you found a solution, I am marking this thread as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need to remove bank details from new order email’ is closed to new replies.