352: 353: 354: public static function botDetected() 355: { 356: return ( 357: isset($_SERVER['HTTP_USER_AGENT']) 358: && preg_match('/bot|crawl|slurp|googlebot|spider|mediapartners/i', $_SERVER['HTTP_USER_AGENT']) 359: ); 360: } 361: 362: public static function getCountrybyURL($url = null) 363: { 364: if ($url) { 365: $url_explode = explode('/', $url); 366: if (!empty($url_explode)) { 367: $isoLang = $url_explode[1]; 368: if ($isoLang == 'en') { 369: $isoLang = 'gb'; 370: } 371: if (!empty($isoLang) && count($isoLang) == 2) { 372: return Country::getByIso($isoLang, false); 373: } 374: } 375: } 376: return Configuration::get('PS_COUNTRY_DEFAULT'); 377: } 378: 379: public static function getGIConfigurations($id_shop = 0, $id_product = 0, $id_customer = 0, $id_country = 0, $id_state = 0, $id_currency = 0, $id_lang = 0, $taxes = false, $discounts = false, $id_product_attribute = 0, $quantity = 0, $qd = false, $onsale = false) 380: { 381: