WooCommerce Add a Title field to WooCommerce checkout / billing fields

Add a billing title field to both the WooCommerce checkout and user profile.

add_filter('woocommerce_billing_fields', 'my_woocommerce_billing_fields');

function my_woocommerce_billing_fields($fields)
{

    $fields['billing_title'] = array(
        'label' => __('Title', 'woocommerce'),
        'required' => false, 
        'clear' => false, 
        'type' => 'select',
		'options' => array(
		  '' => 'choose one',
		  'CEO' => 'CEO',
		  'President' => 'President',
		  'Manager' => 'Manager'
		)
	);		
	
    return $fields;
}
Posted by
Snippet Viewed 288 times.

Share your WooCommerce code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.

 

Submit | Browse

Most Recent woocommerce snippets

Most Viewed