36 $sId = $oUser->
getId();
37 if (array_key_exists($sId, self::$_aUserVatCache) &&
38 self::$_aUserVatCache[$sId] !== null
40 return self::$_aUserVatCache[$sId];
49 $oCountry =
oxNew(
'oxcountry');
50 if (!$oCountry->load($sCountryId)) {
51 throw oxNew(
"oxObjectException");
53 if ($oCountry->isForeignCountry()) {
58 self::$_aUserVatCache[$oUser->
getId()] = $ret;
74 if ($oUser->oxuser__oxustid->value) {
94 $sCatT = getViewName(
'oxcategories');
96 if ($this->_blCatVatSet === null) {
97 $sSelect =
"SELECT oxid FROM $sCatT WHERE oxvat IS NOT NULL LIMIT 1";
101 $this->_blCatVatSet = (bool) $oDb->getOne($sSelect);
104 if (!$this->_blCatVatSet) {
108 $sO2C = getViewName(
'oxobject2category');
109 $sSql =
"SELECT c.oxvat
110 FROM $sCatT AS c, $sO2C AS o2c
111 WHERE c.oxid=o2c.oxcatnid AND
112 o2c.oxobjectid = " . $oDb->quote($oArticle->
getId()) .
" AND
114 ORDER BY o2c.oxtime ";
116 $fVat = $oDb->getOne($sSql);
117 if ($fVat !==
false && $fVat !== null) {
133 startProfile(
"_assignPriceInternal");
136 if (($dArticleVat = $oArticle->
getCustomVAT()) !== null) {
137 stopProfile(
"_assignPriceInternal");
142 stopProfile(
"_assignPriceInternal");
147 stopProfile(
"_assignPriceInternal");
149 return $this->
getConfig()->getConfigParam(
'dDefaultVAT');
194 $blUseShippingCountry = $this->
getConfig()->getConfigParam(
"blShippingCountryVat");
196 if ($blUseShippingCountry) {
200 if (isset($aAddresses[$sSelectedAddress])) {
201 return $aAddresses[$sSelectedAddress]->oxaddress__oxcountryid->value;
205 return $oUser->oxuser__oxcountryid->value;