• Resolved phirefly

    (@phirefly)


    Hello,

    is it possible to only display the VAT field to specific role(s)?

    Or (2nd preference)…

    is it possible to only show the VAT field if customer has entered text in the “Company” field?

    Many Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Diego

    (@daigo75)

    There isn’t currently an option to display the VAT field by role, because the customer may or may not be logged in when completing the purchase. It’s quite common, even for companies, to forget to log in (that’s why we developed a custom solution to automatically assign orders by email, without asking customers to log in every time).

    The EU VAT Assistant does allow to show the VAT number only if a company name is entered. Such option is available out of the box, you just have to select it: https://prntscr.com/d4qcdj.
    If you choose to use that option, we recommend to enable it only for EU addresses. This is because, if you make the VAT number required for any address, even outside the EU, the validation will fail for non-EU countries (extra-EU VAT numbers cannot be validated) and the checkout will be stopped unless you also enable the “Store invalid VAT numbers” option.

    • This reply was modified 8 years ago by Diego.
    Thread Starter phirefly

    (@phirefly)

    Thankyou for the reply – I will use the option in your screenshot however there is a small problem with that option;

    The VAT field is “required”, rather than “optional” – some Companies are not VAT registered.

    Possibly there is a method for me to make the field “optional”?

    Thanks for your support and a great plugin!

    Plugin Author Diego

    (@daigo75)

    By design, the field can be optional, whether the company name is filled or not, or required/required if the company field is entered. The plugin doesn’t include an option to display it only if the company is filled, but you should be able to add your custom logic for that purpose. Just leave the field as “optional”, and write a JavaScript to show/hide it when the company field changes.
    The VAT field can be targeted by calling jQuery('#woocommerce_eu_vat_number').

    Plugin Author Diego

    (@daigo75)

    Note
    Not all VAT registered businesses have a company name. Sole traders often trade in their own name, without using a company name. They can still have an EU VAT number, which they would need to be able to enter, even if the company name field is left empty.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hiding / showing VAT field based on role’ is closed to new replies.