// Hook in
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['order']['order_comments']['placeholder'] = 'Special delivery requirements';
$fields['billing']['billing_company']['label'] = 'Company name if applicable';
$fields['shipping']['shipping_company']['label'] = 'Company name if applicable';
$fields['billing']['billing_address_2']['placeholder'] = 'House number / name';
$fields['shipping']['shipping_address_2']['placeholder'] = 'House number / name';
$fields['billing']['billing_state']['required'] = true;
$fields['billing']['billing_state']['label'] = 'County <abbr class="required" title="required">*</abbr>';
return $fields;
}
I’ve used thIs code to change some fields for the woocommerce checkout form.
For some inexplicable reason, the label for the billing state refuses to change. Even though the label for billing company had changed the successfully, the label for the billing state refuses to. It has successfully become required but I can’t change the label.
Does anyone know what I am doing wrong or if this is a bug.