Country required and validate
-
hi, i’m trying to do something that should be simple but actually for who is not a programmer it’s quite complicated.
in my checkout form i need that the country will be a required and validate field.
after a long research in internet, i could remove the “option” text from the form and mark the field as required with the following code
`add_filter( ‘woocommerce_checkout_fields’ , ‘totalfly_not_required_fields’, 9999 );
function totalfly_not_required_fields( $f ) {
$f[‘billing’][‘billing_country’][‘required’] = true; // that’s it
// the same way you can make any field required, example:
// $f[‘billing’][‘billing_company’][‘required’] = true;return $f;
}’but actually the field still not validate, i mean the customers can checkout even without select the country.
Please could you help me telling how can i make the field validate, i mean necessary to proceed with the order confirmation, and if is not select will appear an error message like in the case of the state field? I’s quite urgent.
thanks a lot
- The topic ‘Country required and validate’ is closed to new replies.