Skip to content

Instantly share code, notes, and snippets.

@KeylorCR
Last active January 29, 2020 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KeylorCR/78863304644a609a77ed27c11d86398e to your computer and use it in GitHub Desktop.
Save KeylorCR/78863304644a609a77ed27c11d86398e to your computer and use it in GitHub Desktop.
Remove woocommerce email addresses on wc_pickup_store shipping method
<?php
function wc_removing_customer_details_in_emails($order, $sent_to_admin, $plain_text, $email) {
if ($order->has_shipping_method('wc_pickup_store')) {
$mailer = WC()->mailer();
remove_action( 'woocommerce_email_customer_details', array( $mailer, 'email_addresses' ), 20, 3 );
}
}
add_action('woocommerce_email_customer_details', 'wc_removing_customer_details_in_emails', 5, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment