• Resolved Jola70

    (@jola70)


    Is it possible to hide VAT field via jQuery?
    I can do this with radio buttons:

    if($("input[name=radio_group]:checked").val() == 'radio1') {
                $("#billing_company_field").hide();
                $("#vat_number_field").hide();
     }

    But how to do this when checkout form is loaded? (radio1 is checked by default)
    And how to prevent to show VAT field when user change country?

Viewing 1 replies (of 1 total)
  • Plugin Author Diego

    (@daigo75)

    What you describe should be doable. You should check with the WooCommerce team which jQuery event is triggered when the checkout form is loaded or updated, and hook your code to that event. Similarly, you can intercept the event that is triggered when the billing country field changes, and run the same code. Something like the following could be a good starting point:

    $('#billing_country').on('change', function() {
      // Do something
    });

    Of course, should you need assistance implementing such customisation, please feel free to get in touch. We offer customisation services and we can help implementing the script to cover your specific needs.

Viewing 1 replies (of 1 total)
  • The topic ‘Hide VAT field via jQuery’ is closed to new replies.