Model/Statistic.php
public function getSiteLocation()
    {
        $countryId = $this->scopeConfig->getValue('general/store_information/country_id');
        if ($countryId) {
            $country = $this->countryFactory->create()->loadByCode($countryId);
            $countryName = $country->getName();
        } else {
            $countryName = 'Unknown country';
        }

        $regionId = $this->scopeConfig->getValue('general/store_information/region_id');
        $regionName = 'Unknown region';
        if ($regionId) {
            $region = $this->regionFactory->create();
            $region = $region->load($regionId);
            if ($region->getId()) {
                $regionName = $region->getName();
            }
        }

        $postCode = $this->scopeConfig->getValue('general/store_information/postcode');
        if (!$postCode) {
            $postCode = 'Unknown zip code';
        }

        return $countryName .' | '.$regionName.' | '.$postCode;
    }
public function getSiteLocation()
    {
        $countryId = $this->scopeConfig->getValue('general/store_information/country_id');
        if ($countryId) {
            $country = $this->countryFactory->create()->loadByCode($countryId);
            $countryName = $country->getName();
        } else {
            $countryName = 'Unknown country';
        }

        $regionId = $this->scopeConfig->getValue('general/store_information/region_id');
        $regionName = 'Unknown region';
        if ($regionId) {
            $region = $this->regionFactory->create();
            $region = $region->load($regionId);
            if ($region->getId()) {
                $regionName = $region->getName();
            }
        }

        $postCode = $this->scopeConfig->getValue('general/store_information/postcode');
        if (!$postCode) {
            $postCode = 'Unknown zip code';
        }

        return $countryName .' | '.$regionName.' | '.$postCode;
    }
public function getSiteLocation ( ) { $ countryId = $ this -> scopeConfig -> getValue ( 'general/store_information/country_id' ) ; if ( $ countryId ) { $ country = $ this -> countryFactory -> create ( ) -> loadByCode ( $ countryId ) ; $ countryName = $ country -> getName ( ) ; } else { $ countryName = 'Unknown country' ; } $ regionId = $ this -> scopeConfig -> getValue ( 'general/store_information/region_id' ) ; $ regionName = 'Unknown region' ; if ( $ regionId ) { $ region = $ this -> regionFactory -> create ( ) ; $ region = $ region -> load ( $ regionId ) ; if ( $ region -> getId ( ) ) { $ regionName = $ region -> getName ( ) ; } } $ postCode = $ this -> scopeConfig -> getValue ( 'general/store_information/postcode' ) ; if ( ! $ postCode ) { $ postCode = 'Unknown zip code' ; } return $ countryName . ' | ' . $ regionName . ' | ' . $ postCode ; }
Get Default Site Location

@return string
Get Default Site Location