I want to pre-populate the values for the checkout's billing fields to the DB stored values of the user before his first purchase.
I've tried the following code:
add_filter( 'woocommerce_checkout_fields' , function ( $fields ) {
$fields['billing']['billing_first_name']['placeholder'] = 'First Name';
$fields['billing']['billing_first_name']['default'] = wp_get_current_user()->user_firstname;
return $fields;
});
I've read about this solution in an other post. Placeholder works great, but the value doesn't.
Also, the WooCommerce Doc (Lesson 1) doesn't say about anything the array value 'default'