public static function getLocatorApiCurrencyCode() { $locatorhq_username = \Config::get("webshoppack::locatorhq_api_username"); $locatorhq_apikey = \Config::get("webshoppack::locatorhq_api_key"); $currencyCode = "USD"; if ($locatorhq_username != "" && $locatorhq_apikey != "") { $ipaddresslist = $_SERVER["REMOTE_ADDR"]; $locator_url = "http://api.locatorhq.com/?user="******"&key=" . $locatorhq_apikey . "&ip=" . $ipaddresslist . "&format=text"; //$result = explode(',',file_get_contents($locator_url)); $result = explode(',', CUtil::getContents($locator_url)); if (sizeof($result) > 1) { $country_name = $result[1]; if ($country_name != "" && $country_name != "-") { $currency_exchange = CurrencyExchangeRate::select('currency_code')->where('country', '=', $country_name)->get(); if (sizeof($currency_exchange) > 0) { return $currency_exchange[0]['currency_code']; } } } } return $currencyCode; }