source/Application/Model/User.php
public function getActiveCountry()
    {
        $sDeliveryCountry = '';
        $soxAddressId = Registry::getSession()->getVariable('deladrid');
        if ($soxAddressId) {
            $oDelAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
            $oDelAddress->load($soxAddressId);
            $sDeliveryCountry = $oDelAddress->oxaddress__oxcountryid->value;
        } elseif ($this->getId()) {
            $sDeliveryCountry = $this->oxuser__oxcountryid->value;
        } else {
            $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
            if ($oUser->loadActiveUser()) {
                $sDeliveryCountry = $oUser->oxuser__oxcountryid->value;
            }
        }

        return $sDeliveryCountry;
    }
public function getActiveCountry()
    {
        $sDeliveryCountry = '';
        $soxAddressId = Registry::getSession()->getVariable('deladrid');
        if ($soxAddressId) {
            $oDelAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
            $oDelAddress->load($soxAddressId);
            $sDeliveryCountry = $oDelAddress->oxaddress__oxcountryid->value;
        } elseif ($this->getId()) {
            $sDeliveryCountry = $this->oxuser__oxcountryid->value;
        } else {
            $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
            if ($oUser->loadActiveUser()) {
                $sDeliveryCountry = $oUser->oxuser__oxcountryid->value;
            }
        }

        return $sDeliveryCountry;
    }
public function getActiveCountry ( ) { $ sDeliveryCountry = '' ; $ soxAddressId = Registry :: getSession ( ) -> getVariable ( 'deladrid' ) ; if ( $ soxAddressId ) { $ oDelAddress = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Address :: class ) ; $ oDelAddress -> load ( $ soxAddressId ) ; $ sDeliveryCountry = $ oDelAddress -> oxaddress__oxcountryid -> value ; } elseif ( $ this -> getId ( ) ) { $ sDeliveryCountry = $ this -> oxuser__oxcountryid -> value ; } else { $ oUser = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; if ( $ oUser -> loadActiveUser ( ) ) { $ sDeliveryCountry = $ oUser -> oxuser__oxcountryid -> value ; } } return $ sDeliveryCountry ; }
Returns user country ID, but If delivery address is given - returns
delivery country.

@return string
Returns user country ID but If delivery address is given - returns delivery country .