source/Application/Model/VatSelector.php
public function getUserVat(\OxidEsales\Eshop\Application\Model\User $oUser, $blCacheReset = false)
    {
        $cacheId = $oUser->getId() . '_' . $oUser->oxuser__oxcountryid->value;

        if (!$blCacheReset) {
            if (array_key_exists($cacheId, self::$_aUserVatCache) &&
                self::$_aUserVatCache[$cacheId] !== null
            ) {
                return self::$_aUserVatCache[$cacheId];
            }
        }

        $ret = false;

        $sCountryId = $this->_getVatCountry($oUser);

        if ($sCountryId) {
            $oCountry = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
            if (!$oCountry->load($sCountryId)) {
                throw oxNew(\OxidEsales\Eshop\Core\Exception\ObjectException::class);
            }
            if ($oCountry->isForeignCountry()) {
                $ret = $this->_getForeignCountryUserVat($oUser, $oCountry);
            }
        }

        self::$_aUserVatCache[$cacheId] = $ret;

        return $ret;
    }
public function getUserVat(\OxidEsales\Eshop\Application\Model\User $oUser, $blCacheReset = false)
    {
        $cacheId = $oUser->getId() . '_' . $oUser->oxuser__oxcountryid->value;

        if (!$blCacheReset) {
            if (array_key_exists($cacheId, self::$_aUserVatCache) &&
                self::$_aUserVatCache[$cacheId] !== null
            ) {
                return self::$_aUserVatCache[$cacheId];
            }
        }

        $ret = false;

        $sCountryId = $this->_getVatCountry($oUser);

        if ($sCountryId) {
            $oCountry = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
            if (!$oCountry->load($sCountryId)) {
                throw oxNew(\OxidEsales\Eshop\Core\Exception\ObjectException::class);
            }
            if ($oCountry->isForeignCountry()) {
                $ret = $this->_getForeignCountryUserVat($oUser, $oCountry);
            }
        }

        self::$_aUserVatCache[$cacheId] = $ret;

        return $ret;
    }
public function getUserVat ( \ OxidEsales \ Eshop \ Application \ Model \ User $ oUser , $ blCacheReset = false ) { $ cacheId = $ oUser -> getId ( ) . '_' . $ oUser -> oxuser__oxcountryid -> value ; if ( ! $ blCacheReset ) { if ( array_key_exists ( $ cacheId , self :: $ _aUserVatCache ) && self :: $ _aUserVatCache [ $ cacheId ] !== null ) { return self :: $ _aUserVatCache [ $ cacheId ] ; } } $ ret = false ; $ sCountryId = $ this -> _getVatCountry ( $ oUser ) ; if ( $ sCountryId ) { $ oCountry = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Country :: class ) ; if ( ! $ oCountry -> load ( $ sCountryId ) ) { throw oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ ObjectException :: class ) ; } if ( $ oCountry -> isForeignCountry ( ) ) { $ ret = $ this -> _getForeignCountryUserVat ( $ oUser , $ oCountry ) ; } } self :: $ _aUserVatCache [ $ cacheId ] = $ ret ; return $ ret ; }
get VAT for user, can NOT be null

@param \OxidEsales\Eshop\Application\Model\User $oUser        given  user object
@param bool                                     $blCacheReset reset cache

@throws oxObjectException if wrong country
@return double | false
get VAT for user can NOT be null