/** * Returns country id which VAT should be applied to. * Depending on configuration option either user billing country or shipping country (if available) is returned. * * @param oxUser $oUser user object * * @return string */ protected function _getVatCountry(oxUser $oUser) { $blUseShippingCountry = $this->getConfig()->getConfigParam("blShippingCountryVat"); if ($blUseShippingCountry) { $aAddresses = $oUser->getUserAddresses($oUser->getId()); $sSelectedAddress = $oUser->getSelectedAddressId(); if (isset($aAddresses[$sSelectedAddress])) { return $aAddresses[$sSelectedAddress]->oxaddress__oxcountryid->value; } } return $oUser->oxuser__oxcountryid->value; }