public function retrieveTaxForClass(TaxClass $taxClass)
    {
        $locale = $this->shopLocation;
        $countryTax = $this->countryTaxRepository->findByLocaleAndTaxClassId($locale, $taxClass->getId());
        if (!$countryTax) {
            $countryTax = $this->countryTaxRepository->findByLocaleAndTaxClassId($locale, TaxClass::STANDARD_TAX_RATE);
            if (!$countryTax) {
                return 0;
            }
        }

        return $countryTax->getTax();
    }
public function retrieveTaxForClass(TaxClass $taxClass)
    {
        $locale = $this->shopLocation;
        $countryTax = $this->countryTaxRepository->findByLocaleAndTaxClassId($locale, $taxClass->getId());
        if (!$countryTax) {
            $countryTax = $this->countryTaxRepository->findByLocaleAndTaxClassId($locale, TaxClass::STANDARD_TAX_RATE);
            if (!$countryTax) {
                return 0;
            }
        }

        return $countryTax->getTax();
    }
public function retrieveTaxForClass ( TaxClass $ taxClass ) { $ locale = $ this -> shopLocation ; $ countryTax = $ this -> countryTaxRepository -> findByLocaleAndTaxClassId ( $ locale , $ taxClass -> getId ( ) ) ; if ( ! $ countryTax ) { $ countryTax = $ this -> countryTaxRepository -> findByLocaleAndTaxClassId ( $ locale , TaxClass :: STANDARD_TAX_RATE ) ; if ( ! $ countryTax ) { return 0 ; } } return $ countryTax -> getTax ( ) ; }
Retrieves the tax depending on the current class and configured shop location.

@param TaxClass $taxClass

@return float
Retrieves the tax depending on the current class and configured shop location .