Multi Vendor - How to hide email and phone number of the customer in the "new order email vendor"

If you want  hide email and phone number of the customer in the "new order email vendor" you can use this code. Paste this in your functions.php of your theme:

if( function_exists( 'YITH_Vendors' ) ){
add_filter( 'woocommerce_email_customer_details_fields', 'yith_woocommerce_email_customer_details_fields', 10, 3 );

if( ! function_exists( 'yith_woocommerce_email_customer_details_fields' ) ){
function yith_woocommerce_email_customer_details_fields( $fields, $sent_to_admin, $order ){
if( $order instanceof WC_Order && $order->post->post_parent != 0 ){
$fields_to_remove = array( 'billing_email', 'billing_phone' );
foreach( $fields_to_remove as $to_remove ){
if( isset( $fields[ $to_remove ] ) ){
unset( $fields[ $to_remove ] );
}
}
}
return $fields;
}
}
}
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk