woocommerce_form_field('billing_country', array(
'type' => 'select',
'class' => array( 'form-row form-row-first address-field update_totals_on_change validate-required woocommerce-validated' ),
'input_class' => array( 'country-to-state' ),
'placeholder' => __('Enter something'),
'default' => $default_country,
'options' => $countries,
'priority' => 5
));
echo '<div class="wrap">';
$fields['billing_shipping']['billing_country'] = array(
'type' => 'select',
'class' => array( 'form-row form-row-first address-field update_totals_on_change validate-required woocommerce-validated' ),
'input_class' => array( 'country-to-state' ),
'placeholder' => __('Enter something'),
'default' => $default_country,
'options' => $countries,
'priority' => 5
);
$fields['billing_shipping']['billing_state'] = array(
'type' => 'select',
'class' => array( 'form-row form-row-last address-field validate-required validate-state woocommerce-invalid woocommerce-invalid-required-field' ),
'input_class' => array( '' ),
'placeholder' => __('Enter something'),
'options' => $default_county_states,
'priority' => 5
);
echo '</div>';
woocommerce_form_field('billing_country', array(
'type' => 'select',
'class' => array( 'form-row form-row-first address-field update_totals_on_change validate-required woocommerce-validated' ),
'input_class' => array( 'country-to-state' ),
'placeholder' => __('Enter something'),
'default' => $default_country,
'options' => $countries,
'priority' => 5
));
$fields['billing']['billing_country'] = array(
'type' => 'select',
'class' => array( 'form-row form-row-first address-field update_totals_on_change validate-required woocommerce-validated' ),
'input_class' => array( 'country-to-state' ),
'placeholder' => __('Enter something'),
'default' => $default_country,
'options' => $countries,
'priority' => 5
);
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
woocommerce_form_field('billing_country', array(
'type' => 'select',
'class' => array( 'form-row form-row-first address-field update_totals_on_change validate-required woocommerce-validated' ),
'input_class' => array( 'country-to-state' ),
'placeholder' => __('Enter something'),
'default' => $default_country,
'options' => $countries,
'priority' => 5
));
woocommerce_form_field('billing_state', array(
'type' => 'select',
'class' => array( 'form-row form-row-last address-field validate-required validate-state woocommerce-invalid woocommerce-invalid-required-field' ),
'input_class' => array( '' ),
'placeholder' => __('Enter something'),
'options' => $default_county_states,
'priority' => 5
));
return $fields;
}
woocommerce_form_field('billing_country', array(
)
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['shipping']['shipping_phone'] = array(
'label' => __('Phone', 'woocommerce'),
'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);
return $fields;
}
$methodUrl = 'https://api.vk.com/method/database.getCountries&need_all=1&count=1000&access_token=ACCESS_TOKEN&v=5.103'
$arg = [
250 => [
0 => 'RU',
1 => 'Россия'
]
]
$arg2 = [
'RU'=> [
0 => 'Московская область',
1 => 'Ленинградская область',
и т.д.
]
]