Show VAT field only if company field is filled and not at all when base country?
-
So this is my issue:
When from country Estonia I want to hide VAT because base country is Estonia (this works fine by unchecking the “Show EU VAT field when customer is located in base country” box).When from Finland, the VAT fields shows up even if customer is not a company.
So I tried to hide the field so that the VAT field would only show up when something is typed into company field and it works but not when country is base (Estonia) country.
Then it shows the VAT field for a moment and then hides. Check the video: https://www.loom.com/share/4c74cf63969949e0a1f02a3e107ac9c5Is it possible to add this option to future updates, that show VAT field only if company field is filled?
add_action( 'woocommerce_after_checkout_form', 'bbloomer_conditionally_hide_show_checkout_field1', 9999 ); function bbloomer_conditionally_hide_show_checkout_field1() { wc_enqueue_js( " jQuery('#billing_company').keyup(function() { if (jQuery(this).val().length == 0) { jQuery('#vat_number_field').hide(); } else { jQuery('#vat_number_field').show(); } }).keyup(); "); }
- The topic ‘Show VAT field only if company field is filled and not at all when base country?’ is closed to new replies.