The “red” is the style that WooCommerce applies to a field when the value in that field is not valid. In the case of the EU VAT Assistant, the VAT number field is validated every time its value changes, or whenever WooCommerce triggers the “address updated” event (i.e. when any “address” field changes). This is by design.
If the field appears as red on the checkout page, it means that the value is not valid. For example, if you configured the field to be required, or required for EU countries, it will appear as red when it’s left empty.
Since the validation logic can be triggered whenever the address changes, if the VAT number field is set as required, it can appear in red as soon as the customer enters some data that triggers that event. That can be considered as a “reminder” that the VAT number field should be filled.
To change this logic, you have two options:
1. Set the VAT number field as “optional” in the plugin settings. With the field set as optional, the validation will only run if the field has been populated, because it’s allowed to be empty.
2. If you wish to keep the field as “required”, you can change its styles via CSS, so that it remains unaltered. Example:
.woocommerce-checkout .woocommerce .aelia_wc_eu_vat_assistant input#vat_number {
border-color: #c9c9c9 !important;
background: #fcfcfc;
border-radius: 3px;
}
Note: the VAT number validation logic will still run when the checkout process starts. If the VAT number is required, but empty at that point, the EU VAT Assistant will raise an error and stop the checkout.