• Resolved Ameer hamza

    (@ameer-hamza)


    Hi,
    when the new order is placed woocommerce send email to customer and admin. i want to hide order information from that email only for customers but not for admin. i have successfully removed the order information from email using this code

    function remove_order_details_from_email_woo( $order, $sent_to_admin, $plain_text, $email ){
        $mailer = WC()->mailer(); // get the instance of the WC_Emails class
        remove_action( 'woocommerce_email_order_details', array( $mailer, 'order_details' ), 10, 4 );
    
    }
    add_action('woocommerce_email_order_details','remove_order_details_from_email_woo', 5, 4 );
    
    function removing_customer_details_in_emails( $order, $sent_to_admin, $plain_text, $email ){
        $wmail = WC()->mailer();
        remove_action( 'woocommerce_email_customer_details', array( $wmail, 'email_addresses' ), 20, 3 );
    }
    add_action( 'woocommerce_email_customer_details', 'removing_customer_details_in_emails', 5, 4 );
    

    But this code also hide the order information from admin side as well. i want to hide these information only for customers but i want to keep them in admin email.
    how can i put check for customers. kindly help
    i hope you understand what i mean

    regards,
    Ameer

    • This topic was modified 5 years, 3 months ago by Ameer hamza.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide some elements when order email is send to customers’ is closed to new replies.