wooCommerce checkout page State / County (optional) validate not working
that is my added code
add_filter(‘thwcfd_State_field_override_required’,’__return_true’);
any idea for how to add mandatory for the State / County (optional)
like as State / County (optional)*
look my issue
wooCommerce checkout page State / County (optional) validate not working
that is my added code
add_filter(‘thwcfd_State_field_override_required’,’__return_true’);
any idea for how to add mandatory for the State / County (optional)
like as State / County (optional)*
look my issue
Code goes in function.php
file of your active child theme (or active theme). It could works.
add_filter( 'woocommerce_billing_fields', 'woo_filter_state_billing', 10, 1 );
function woo_filter_state_billing( $address_fields ) {
$address_fields['billing_state']['required'] = true;
return $address_fields;
}
add_filter( 'woocommerce_shipping_fields', 'woo_filter_state_shipping', 10, 1 );
function woo_filter_state_shipping( $address_fields ) {
$address_fields['shipping_state']['required'] = true;
return $address_fields;
}
$states['LK']['CK'] = __('Colombo', 'woocommerce'); $states['LK']['RT'] = __('Kandy', 'woocommerce'); return $states; }
– core114 Commented Nov 30, 2018 at 9:17