Hi @jhonnwest,
The issue is probably related to the use of the conditional if ( is_checkout() )
. This function will not detect requests made via AJAX which are used to update the checkout parts, including many checkout fields.
You would probably want to remove that conditional as the fields should be set as required.
Otherwise, you can use the function FluidCheckout_Steps::instance()->is_checkout_page_or_fragment()
introduced with the latest version of Fluid Checkout Lite (2.1.0).
Below is the code using the conditional with the function mentioned:
add_filter( 'woocommerce_billing_fields', 'fluidcheckout_checkout_billing_fields', 9999 );
add_filter( 'woocommerce_shipping_fields', 'fluidcheckout_checkout_shipping_fields' , 9999 );
function fluidcheckout_checkout_billing_fields( $fields ) {
if ( class_exists( 'FluidCheckout_Steps' ) && FluidCheckout_Steps::instance()->is_checkout_page_or_fragment() ) {
if ( isset( $fields['billing_neighborhood'] ) ) {
$fields['billing_neighborhood']['required'] = true;
}
}
return $fields;
}
function fluidcheckout_checkout_shipping_fields( $fields ) {
if ( class_exists( 'FluidCheckout_Steps' ) && FluidCheckout_Steps::instance()->is_checkout_page_or_fragment() ) {
if ( isset( $fields['shipping_neighborhood'] ) ) {
$fields['shipping_neighborhood']['required'] = true;
}
}
return $fields;
}
I also changed the hooked function names to avoid conflicts with other components which might be adding functions with the same name.
I hope this helps already.
I’m closing this topic for now. If you need further assistance just reply to it.
Best,
Diego.