Back to list of all filter and action hooks for Address Book for WooCommerce.
Description #
Define billing fields that should have its value forced from the address book entry value.
Parameters #
$field_keys(array) Array of field keys.first_name(string) First name.last_name(string) Last name.address_1(string) Address line 1.address_2(string) Address line 2.city(string) City.state(string) State/Province.postcode(string) Postal code.country(string) Country.company(string) Company.phone(string) Phone.email(string) Email.
Examples #
/**
* Change the billing fields to force set value from the address book entry.
*
* @param array $field_keys The field keys.
*/
public function change_address_book_force_set_value_field_keys( $field_keys ) {
$field_keys[] = 'billing_vat_number';
// Maybe add shipping VAT number
// for using on billing address if same as shipping is checked.
if ( 'one_per_address_entry' === FluidCheckout_Settings::instance()->get_option( 'fc_vat_number_per_account_limit' ) ) {
$field_keys[] = 'shipping_vat_number';
}
return $field_keys;
}
add_filter( 'fc_pro_address_book_billing_force_set_value_field_keys', array( $this, 'change_address_book_force_set_value_field_keys' ), 10 );
