Open samikeijonen opened 9 years ago
I agree on this. But there is no real other way, I'm afraid. We can't do this onChange
for example of the text box, because there are a variable number of characters in EU VAT numbers, so we don't know by what number of characters we need to query the API.
Now that we're on the subject, @pippinsplugins do you think it is possible to have some sort of loading spinner on the checkout while it is doing things like recalculating taxes and such? Since we do the tax rate lookup live on the checkout, there might be a delay of half a second on the checkout form. That's enough for the end user to hit the button at the end of the form, before the tax rates are updated. This doesn't invalidate the order, because during processing of the order it still verifies the calculation, but it can throw the user off if the order eventually contains a different tax value.
Perhaps you have an idea for when this VAT check can trigger? Maybe I can disable the final button on the checkout form as soon as someone starts typing in the VAT number field, then enable it again once the field is emptied or the VAT number is validated, maybe?
@coenjacobs Similar to how Woo's checkout gets blocked when updating?
@pippinsplugins Yes, pretty much exactly like WooCommerce does it would do the trick.
VAT number check is great feature.
Now there is only Purchase button to be clicked and it's unlikely that user would click some other area of the checkout page before clicking purchase button.