public function getCountryByIp($ip) { if (!$this->isFileExists()) { return null; } $SxGeo = new GeoIP_SxGeo($this->local_file); $country = $SxGeo->getCountry($ip); if ($country) { return $country; } return Mage::getStoreConfig('geoip/general/country'); }