For some reason, my WooCommerce isn’t showing labels nor placeholders for custom fields. No matter whether I’m adding the fields manually through functions.php (code below) or using plugins like ‘WooCommerce Mailchimp’, the fields shows up alright but there’s no label next to it.
What might be causing this type of error?
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
$fields['shipping']['shipping_phone'] = array(
'label' => __('Phone', 'woocommerce'),
'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);
return $fields;
}
Change the key from
shipping_phone
to something else.It seems like some key names are reserved even if they are not shown in the checkout fields list: http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/