Adding a new drop-down field to billing address form
-
Hello,
I would like to add a drop-down field to the billing address on the checkout page.
I have found this code:
// Hook in add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); // Our hooked in function - $fields is passed via the filter! function custom_override_checkout_fields( $fields ) { $fields['billing']['billing_phone'] = array( 'label' => __('Phone', 'woocommerce'), 'placeholder' => _x('Phone', 'placeholder', 'woocommerce'), 'required' => false, 'class' => array('form-row-wide'), 'clear' => true ); return $fields; }
Which displays a basic text field.
How can I display a field with drop down options? e.g. Title: Mr, Mrs etcThanks
- The topic ‘Adding a new drop-down field to billing address form’ is closed to new replies.