// Hook in
add_filter( 'woocommerce_default_address_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$fields = array (
'payer_type' =>
array(
'label' => __('Тип плательщика:', 'woocommerce'),
'placeholder' => _x('Payer Type', 'placeholder', 'woocommerce'),
'required' => true,
'class' => array('form-row-wide'),
'clear' => true,
'type' => 'radio',
'options' => array('Для себя (физическое лицо)', 'Для органиции (юридическое лицо)'),
'priority' => 10,
),
'company' => array(
'label' => __( 'Company name', 'woocommerce' ),
'class' => array( 'form-row-wide' ),
'autocomplete' => 'organization',
'priority' => 30,
'required' => true,
),
'inn' => array(
'label' => __( 'ИНН:', 'woocommerce' ),
'placeholder' => 'Введите ваш ИНН',
'required' => true,
'class' => array( 'form-row-first' ),
'autocomplete' => 'inn-number',
'priority' => 10,
),
'kpp' => array(
'label' => __( 'КПП:', 'woocommerce' ),
'placeholder' => 'Введите ваш КПП',
'required' => true,
'class' => array( 'form-row-last' ),
'autocomplete' => 'kpp-number',
'priority' => 10,
),
'legal_address' => array(
'label' => __( 'Юридический адрес:', 'woocommerce' ),
'placeholder' => 'Введите ваш Юридический адрес',
'required' => true,
'class' => array( 'form-row-wide' ),
'autocomplete' => 'legal-address',
'priority' => 10,
),
'actual_address' => array(
'label' => __( 'Фактический адрес:', 'woocommerce' ),
'placeholder' => 'Введите ваш Фактический адрес',
'required' => true,
'class' => array( 'form-row-wide' ),
'autocomplete' => 'actual-address',
'priority' => 10,
),
'сhecking_account' => array(
'label' => __( 'Расчетный счет:', 'woocommerce' ),
'placeholder' => 'Введите номер Расчетного счета',
'required' => true,
'class' => array( 'form-row-first' ),
'autocomplete' => 'сhecking_account',
'priority' => 10,
),
'bik_number' => array(
'label' => __( 'БИК:', 'woocommerce' ),
'placeholder' => 'Введите БИК',
'required' => true,
'class' => array( 'form-row-last' ),
'autocomplete' => 'bik_number',
'priority' => 10,
),
'last_name' => array(
'label' => __( 'Last name', 'woocommerce' ),
'required' => true,
'class' => array( 'form-row-first' ),
'autocomplete' => 'family-name',
'priority' => 10,
),
'first_name' => array(
'label' => __( 'First name', 'woocommerce' ),
'required' => true,
'class' => array( 'form-row-last' ),
'autocomplete' => 'given-name',
'priority' => 20,
),
'patronymic_name' => array(
'label' => __( 'Отчество', 'woocommerce' ),
'required' => false,
'class' => array( 'form-row-first' ),
'autocomplete' => 'patronymic-name',
'priority' => 20,
),
'position_name' => array(
'label' => __( 'Должность', 'woocommerce' ),
'required' => false,
'class' => array( 'form-row-last' ),
'autocomplete' => 'position-name',
'priority' => 20,
),
'postcode' => array(
'label' => __( 'Postcode / ZIP', 'woocommerce' ),
'required' => true,
'class' => array( 'form-row-wide', 'address-field' ),
'validate' => array( 'billing-postcode' ),
'autocomplete' => 'postal-code',
'priority' => 90,
),
'phone' => array(
'label' => __( 'Phone', 'woocommerce' ),
'required' => 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ),
'type' => 'tel',
'class' => array( 'form-row-first' ),
'validate' => array( 'phone' ),
'autocomplete' => 'tel',
'priority' => 100,
),
'email' => array(
'label' => __( 'Email address', 'woocommerce' ),
'required' => true,
'type' => 'email',
'class' => array( 'form-row-last' ),
'validate' => array( 'email' ),
'autocomplete' => 'no' === get_option( 'woocommerce_registration_generate_username' ) ? 'email' : 'email username',
'priority' => 110,
)
);
return $fields;
}