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'); }
public function getCityByIp($ip) { if (!$this->isFileExists()) { return null; } $SxGeo = new GeoIP_SxGeo($this->local_file); $city_full = $SxGeo->getCity($ip); unset($SxGeo); if ($city_full['city']['name_ru'] != '') { return $city_full['city']['name_ru']; } return Mage::getStoreConfig('geoip/general/city'); }