F4 Salutation Fields for WooCommerce adds a dropdown menu (more field types coming soon) to select the address salutation to the billing and/or shipping address.
The plugin prepends the salutation automatically before the name in every formatted address output. Here are a few more things the plugin does:
Currently only Mr. and Mrs. are shown in the salutation field. If you want to add more or translate this values, see the code snippet below.
This plugin works out-of-the-box. By default, both salutation fields for billing and shipping are enabled and marked as required.
You can change the settings for both fields on the Accounts & Privacy screen in your WooCommerce settings. Both fields you can hide or set to optional/required.
If you want to add more salutations, change the labels or add your own translations, you can use this hook:
add_filter('F4/WCSF/get_salutation_options', function($options, $settings) {
// Change label
$options['mr'] = 'Mister';
// Add new labels
$options['dr'] = 'Dr.';
$options['prof'] = 'Prof.';
return $options;
}, 10, 2);