I am currently making my own checkout-page for a client, and i want to intergrate the country selector. I have been looking through i for hours, and cant seem to figure out what is wrong.
Woocommerce just comes up with the message: Billing Country is a required field. Please enter an address to continue.
I tried to delete some class', some code here and there. But cant seem to figure out what is wrong!
What am i missing?
I have tried to just have an Input-field where the costumer can write DK, GB US and so one. IT works, but only when the costumer types the country code in with all caps, correct aligned.... etc.
<"paragraf" 'class="form_country address-field 'update_totals_on_change form-group single-country validate-required" id="billing_country_field" data-priority="60">
<"label" for="billing_country" class="">Country <abbr class="required" title="required">*</abbr></label>
<?php
global $woocommerce;
$countries_obj = new WC_Countries();
$countries = $countries_obj->__get('countries');
echo '<div id="my_custom_countries_field"><h2>' . __('') . '</sd2>';
woocommerce_form_field('my_country_field', array(
'type' => 'select',
'for' => 'billing_country',
'name' => 'billing_country',
'id' => 'billing_country',
'class' => array( 'form_country address-field update_totals_on_change form-group single-country validate-required' ),
'placeholder' => __('Choose a country'),
'default' => 'DK',
'clear' => 'true',
'options' => $countries
)
);
echo '</div>';
?>