PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Services/Localization/LocalizationManager.php +22 -6 1.3.23 → 1.6.5 View file →
@@ -116,19 +116,19 @@
116 116 * Get all continents
117 117 */
118 118 public function taxContinents($countryCode = null): array
119 119 {
120 - if (is_array(self::$continents)) {
120 + if (is_array(self::$taxContinents)) {
121 121 if ($countryCode) {
122 - return self::$continents[$countryCode] ?? [];
122 + return self::$taxContinents[$countryCode] ?? [];
123 123 }
124 - return self::$continents;
124 + return self::$taxContinents;
125 125 }
126 - self::$continents = require 'i18n/eu_tax_countries.php';
126 + self::$taxContinents = require 'i18n/eu_tax_countries.php';
127 127 if ($countryCode) {
128 - return self::$continents[$countryCode] ?? [];
128 + return self::$taxContinents[$countryCode] ?? [];
129 129 }
130 - return self::$continents;
130 + return self::$taxContinents;
131 131 }
132 132
133 133 /**
134 134 * Get all phone codes
@@ -379,8 +379,24 @@
379 379 return $continentCode;
380 380 }
381 381 }
382 382 return '';
383 + }
384 +
385 + /**
386 + * Check whether a country is part of the EU VAT country list.
387 + */
388 + public function isEuTaxCountry(string $countryCode): bool
389 + {
390 + $countryCode = trim(strtoupper($countryCode));
391 +
392 + if ($countryCode === '') {
393 + return false;
394 + }
395 +
396 + $euCountries = Arr::get($this->taxContinents('EU'), 'countries', []);
397 +
398 + return in_array($countryCode, $euCountries, true);
383 399 }
384 400
385 401 /**
386 402 * Get calling code for a country