Hello guys.
We are trying to edit some values of checkout fields by code in functions.php. We have done this in past in other eshops.
We have put the code below in our file:
/* Hook in*/
add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’, 1 );
function custom_override_checkout_fields( $fields ) {
$fields[‘billing’][‘billing_state’][‘required’] = true;
$fields[‘billing’][‘billing_company’][‘priority’] = ‘1003’;
$fields[‘billing’][‘billing_address_2’][‘placeholder’] = ‘Όροφος, διαμέρισμα κτλ. (προαιρετικό)’;
return $fields;
}
You can find our checkout form here:
https://woocommerce-170844-802553.cloudwaysapps.com/checkout
The strange thing about this is that the fields are starting working at this way we mention here but then it change again to default ones. Maybe this happen from your theme javascript? If not, how this happens?