Skip to content

Commit

Permalink
feature: match VAT country prefix and country code.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyskoczilova committed Sep 25, 2023
1 parent 16b2d50 commit e057593
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/filters-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ function woolab_icdic_checkout_field_process() {
// Check if in EU
if ( $countries->isCountryCodeInEU( $country ) ) {

// Match VAT country prefix and country code.
// @since 1.7.3.
if ( substr( $dic, 0, 2) != $country ) {
wc_add_notice( __( 'The billing country does not correspond to the country of the VAT number.', 'woolab-ic-dic' ), 'error' );
}

// If Validate in VIES
// Slovak DIC cannot (and shouldn't) be validated in VIES
if ( woolab_icdic_vies_check() && $country != 'SK' ) {
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Either post it on [GitHub](https://github.com/vyskoczilova/kybernaut-ic-dic) or
= 1.7.3 () =

* Feature: Localize address format for all EU countries.
* Feature: Additional check - billing country and VAT country prefix must match.

= 1.7.2 (2023-08-02) =

Expand Down

0 comments on commit e057593

Please sign in to comment.