feat(main): Add configurable EU country allow-list

This commit is contained in:
2026-09-11 17:00:33 +02:00
parent 6f7362c42a
commit 065c60b2a3
7 changed files with 124 additions and 4 deletions
+11 -1
View File
@@ -1,6 +1,7 @@
<?php
use Websmid\VatCheck\Config\Config;
use Websmid\VatCheck\Model\EuCountryAllowList;
if (!defined('_PS_VERSION_')) {
exit;
@@ -12,5 +13,14 @@ function upgrade_module_1_0_3($module)
return false;
}
return Configuration::updateValue(Config::VALIDATE_COMPANY_CONFIG_KEY, Config::VALIDATE_COMPANY_DEFAULT);
if (!Configuration::updateValue(Config::VALIDATE_COMPANY_CONFIG_KEY, Config::VALIDATE_COMPANY_DEFAULT)) {
return false;
}
// All countries enabled by default, so upgrading doesn't silently narrow
// exemption eligibility for a shop already relying on the old behavior.
return Configuration::updateValue(
Config::EU_COUNTRIES_CONFIG_KEY,
json_encode(EuCountryAllowList::getAllSupportedIsoCodes())
);
}