radishconcepts / edd-vatinfoeu

Development repository of the Easy Digital Downloads plugin for the EU VAT Info API
https://wordpress.org/plugins/edd-vatinfoeu/
2 stars 0 forks source link

VAT number behaviour #14

Open samikeijonen opened 9 years ago

samikeijonen commented 9 years ago

VAT number check is great feature.

  1. Enter correct VAT number at the bottom of the checkout page.
  2. Need to click somewhere on the page before tax goes back to zero. Is it possible to create "live check"? Meaning as soon as I have written correct VAT number tax would go back to zero without clicking somewhere on the page.

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.

coenjacobs commented 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?

pippinsplugins commented 9 years ago

@coenjacobs Similar to how Woo's checkout gets blocked when updating?

coenjacobs commented 9 years ago

@pippinsplugins Yes, pretty much exactly like WooCommerce does it would do the trick.