I'm trying to add custom fields to my WooCommerce checkout scheme (although this could be a situation with custom fields anywhere). I want to add two, but each attempt I've tried to run a function, it only adds the first custom field and not the second. Where in my code does this need to be cleaned up?
function dv_add_checkout_fields( $fields ) {
$fields['billing_age'] = array(
'label' => __( 'Age of the kid(s) you mainly do activities with?' ),
'type' => 'select',
'class' => array( 'form-row-wide' ),
'priority' => 150,
'required' => true,
'options' => array( '0-2', '3-5', '6-8', '9-12' ),
);
array(
'label' => __( 'Which part of LA do you live in or are closest to?' ),
'type' => 'select',
'class' => array( 'form-row-wide' ),
'priority' => 150,
'required' => true,
'options' => array( 'Central LA', 'East LA', 'San Fernando Valley', 'San Gabriel Valley', 'South Bay', 'West LA', 'Orange County' ),
);
return $fields;
}
add_filter( 'woocommerce_billing_fields', 'dv_add_checkout_fields' );