Hide shipping phone and email for logged out users
-
Hi,
I am trying to use below code to hide the shipping email and phone field for logged out users, in the checkout. But the fields are still showing. Got any recommendation for how to hide it?
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { if( !is_user_logged_in() ){ unset($fields['billing']['billing_company']); unset($fields['billing']['billing_vat_number']); unset($fields['shipping']['shipping_phone']); unset($fields['shipping']['shipping_email']); } return $fields; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Hide shipping phone and email for logged out users’ is closed to new replies.