storeManager->getStore($storeId)->getWebsite()->getCode(); if (in_array($websiteCode, ['uk', 'gb_site'], true)) { return new TaxContext( self::MODE_UK_STANDARD, 20.0, EuCountries::toAppliedRate(20.0), false ); } if (!in_array($websiteCode, ['eu', 'eu_site'], true)) { return new TaxContext(self::MODE_NO_TAX, 0.0, 0.0, false); } $countryId = strtoupper($shippingCountryId); if (!$this->euCountries->isEu($countryId)) { return new TaxContext(self::MODE_NO_TAX, 0.0, 0.0, false); } $nominalRate = $this->euCountries->getRate($countryId); $appliedRate = $this->euCountries->getAppliedRate($countryId); $approvedVat = $this->applications->findApproved($customerId, $countryId); if ($approvedVat !== null) { return new TaxContext( self::MODE_EU_VAT_REGISTERED, $nominalRate, $appliedRate, false, $approvedVat ); } return new TaxContext(self::MODE_EU_STANDARD, $nominalRate, $appliedRate, false); } }