source/Application/Model/User.php
protected function _setAutoGroups($sCountryId)
    {
        // assigning automatically to specific groups
        $blForeigner = true;
        $blForeignGroupExists = false;
        $blInlandGroupExists = false;

        $aHomeCountry = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry');
        // foreigner ?
        if (is_array($aHomeCountry)) {
            if (in_array($sCountryId, $aHomeCountry)) {
                $blForeigner = false;
            }
        } elseif ($sCountryId == $aHomeCountry) {
            $blForeigner = false;
        }

        if ($this->inGroup('oxidforeigncustomer')) {
            $blForeignGroupExists = true;
            if (!$blForeigner) {
                $this->removeFromGroup('oxidforeigncustomer');
            }
        }

        if ($this->inGroup('oxidnewcustomer')) {
            $blInlandGroupExists = true;
            if ($blForeigner) {
                $this->removeFromGroup('oxidnewcustomer');
            }
        }

        if (!$blForeignGroupExists && $blForeigner) {
            $this->addToGroup('oxidforeigncustomer');
        }
        if (!$blInlandGroupExists && !$blForeigner) {
            $this->addToGroup('oxidnewcustomer');
        }
    }
protected function _setAutoGroups($sCountryId)
    {
        // assigning automatically to specific groups
        $blForeigner = true;
        $blForeignGroupExists = false;
        $blInlandGroupExists = false;

        $aHomeCountry = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry');
        // foreigner ?
        if (is_array($aHomeCountry)) {
            if (in_array($sCountryId, $aHomeCountry)) {
                $blForeigner = false;
            }
        } elseif ($sCountryId == $aHomeCountry) {
            $blForeigner = false;
        }

        if ($this->inGroup('oxidforeigncustomer')) {
            $blForeignGroupExists = true;
            if (!$blForeigner) {
                $this->removeFromGroup('oxidforeigncustomer');
            }
        }

        if ($this->inGroup('oxidnewcustomer')) {
            $blInlandGroupExists = true;
            if ($blForeigner) {
                $this->removeFromGroup('oxidnewcustomer');
            }
        }

        if (!$blForeignGroupExists && $blForeigner) {
            $this->addToGroup('oxidforeigncustomer');
        }
        if (!$blInlandGroupExists && !$blForeigner) {
            $this->addToGroup('oxidnewcustomer');
        }
    }
protected function _setAutoGroups ( $ sCountryId ) { // assigning automatically to specific groups $ blForeigner = true ; $ blForeignGroupExists = false ; $ blInlandGroupExists = false ; $ aHomeCountry = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aHomeCountry' ) ; // foreigner ? if ( is_array ( $ aHomeCountry ) ) { if ( in_array ( $ sCountryId , $ aHomeCountry ) ) { $ blForeigner = false ; } } elseif ( $ sCountryId == $ aHomeCountry ) { $ blForeigner = false ; } if ( $ this -> inGroup ( 'oxidforeigncustomer' ) ) { $ blForeignGroupExists = true ; if ( ! $ blForeigner ) { $ this -> removeFromGroup ( 'oxidforeigncustomer' ) ; } } if ( $ this -> inGroup ( 'oxidnewcustomer' ) ) { $ blInlandGroupExists = true ; if ( $ blForeigner ) { $ this -> removeFromGroup ( 'oxidnewcustomer' ) ; } } if ( ! $ blForeignGroupExists && $ blForeigner ) { $ this -> addToGroup ( 'oxidforeigncustomer' ) ; } if ( ! $ blInlandGroupExists && ! $ blForeigner ) { $ this -> addToGroup ( 'oxidnewcustomer' ) ; } }
Automatically assigns user to specific groups
according to users country information

@param string $sCountryId users country id
Automatically assigns user to specific groups according to users country information