4

I'm trying to remove the autoloaded user info in the various checkout fields but cannot seem to find any way to access the fields value. I've tried the following which clears formatting, removes, the field, etc. but nothing I can find shows how to remove just the value. Does anyone know how to access this?

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {

$fields['billing']['billing_first_name']['placeholder'] = '';
$fields['billing']['billing_last_name']['value'] = '';
unset($fields['billing']['billing_company']);
return $fields;
}
Buster
  • 687
  • 1
  • 7
  • 25

1 Answers1

4

Register filter:

 add_filter( 'woocommerce_checkout_get_value' , 'clear_checkout_fields' );

Add this function. All fields will be empty.

 function clear_checkout_fields($input)
    {
        return '';
    }
Roland
  • 972
  • 7
  • 15