vyskoczilova / kybernaut-ic-dic

Kybernaut IC DIC (WordPress plugin): Přidá IČO a DIČ do formuláře s fakturační adresou ve WooCommerce a rovnou ověří, jestli jsou zadané hodnoty skutečné.
GNU General Public License v3.0
12 stars 7 forks source link

Allow an order placing when business ID or VAT number validation fails for technical reasons #72

Closed PavelVybiral closed 4 months ago

PavelVybiral commented 5 months ago

Description & Link to The Issue

When customer fills business ID or VAT number, the business ID or VAT number validation is enabled and ARES or VIES is down for some reason (e.g. maintenance or technical issue), customer can't place an order.

This PR introduces a feature that allows customer to place an order even when ARES or VIES is down. By default, the plugin behaves the same way, but there is a new checkbox "Ignore when ARES or VIES check fails for technical reasons" in plugin settings. If this option is enabled and validation of business ID or VAT number fails for technical reason (not because it is invalid), an order is placed.

For orders at which validation fails, there is an alert at admin edit screen and in admin e-mails (see screenshots).

What kind of change does this PR introduce?

Does this PR introduce a breaking change?

Preview (Screenshot/Gif):

obrazek obrazek obrazek

vyskoczilova commented 4 months ago

Hi Pavel! Thanks a lot! I'll have a look at it next week and merge; so far, it looks good. One more thing - could you make some notice as well on the order screen? Or maybe we could send an email? What do you think?

PavelVybiral commented 4 months ago

Hi Karolína, thank you. I'm not sure I understand. What exactly do you mean by the order screen, please? :)

vyskoczilova commented 4 months ago

Hi Pavel, I thought either here:

image

Or maybe better to get an e-mail notification?

K.

PavelVybiral commented 4 months ago

Hi Karolína, I've added the notice in orders table below an order number. I didn't want to add an extra column for the message which will be shown for about 1 of 100 orders, so I chose this way. :)

obrazek

I also moved the notice in admin e-mails above the order details so the recipient won't miss it. I recommend not to send an extra e-mail notification when VAT number verification fails, because I think it would be redundant.

obrazek

Thank you. :)

vyskoczilova commented 4 months ago

@PavelVybiral Awesome! It works like a charm! I've changed just a tiny things and added HPOS support for the notice in the admin order list, otherwise I didn't need to touch it.

Is this readme info OK with you? If not, feel free to modify: https://github.com/vyskoczilova/kybernaut-ic-dic/pull/72/files#diff-9e6e4772050998a5c0dc3c61acf3dab0a7e594566171fa5746d6b62f9598efb6L132 And I'll merge and release the new version.

PavelVybiral commented 4 months ago

Hi Karolína, thank you for changes you've made and for your feedback. I'm OK with readme info, so I would be happy if you merge changes and release a new version of the plugin.

Thank you so much! :)

vyskoczilova commented 4 months ago

It's in the wild now as 1.9.0 even with Czech translation, hope it will be a no trouble update :) Thanks for the contribution!