feat(main): Add configurable EU country allow-list
This commit is contained in:
@@ -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())
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user