[Woo Checkout Editor] Conditional display of field based on country name not working

As above.

Have two fields set up (billing_abn_number & billing_gst_number) which should only be displayed if the country is set to Australia, set up like this:

However, they are always visible no matter what the country is set to:

What’s going on here?

Cheers.

Hello @liquidedge,

Thanks for writing in! :slight_smile:

It’s quite weird. I’ve set the fields billing_abn_number and billing_gst_number to Disabled and still wasn’t working. I’ve also deactivated plugins, and can see you have no JS errors on the console.

Can you try adding the code below into the functions.php of your X child theme, and let us know how it goes?

function wc_ninja_remove_checkout_field( $fields ) {
	if ( $fields['billing']['billing_company'] == 'Australia' ) 
        unset( $fields['billing']['billing_abn_number'] );
        unset( $fields['billing']['billing_gst_number'] );
          
	return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'wc_ninja_remove_checkout_field' );

Thank you.

Hmm, that doesnt appear to have really helped.

Now, no matter what country is set, the ABN number field is always visible, and the GST number is never visible…

Hi there,

I did test the case and the problem is there. I already added this to our issue tracker.

Please stay tuned for upcoming releases to have a fix regarding this. At the moment you will not be able ot use the condition feature of the plugin.

Thank you for your understanding and patience.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.