// Updated Addons API call in the search

This commit is contained in:
Damien Metzger
2013-11-21 18:34:42 +01:00
parent f7ad627b4d
commit 47531534fc
+3 -7
View File
@@ -199,13 +199,9 @@ class AdminSearchControllerCore extends AdminController
if (!is_numeric(trim($this->query)) && !Validate::isEmail($this->query))
{
$vars = http_build_query(array(
'version' => _PS_VERSION_,
'iso_lang' => Tools::strtolower(Context::getContext()->language->iso_code),
'iso_code' => Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
'search_query' => $this->query
));
if (($json_content = Tools::file_get_contents('https://api.addons.prestashop.com/search.php?'.$vars)) != false)
$iso_lang = Tools::strtolower(Context::getContext()->language->iso_code);
$iso_country = Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT')));
if (($json_content = Tools::file_get_contents('https://api.addons.prestashop.com/'._PS_VERSION_.'/search/'.urlencode($this->query).'/'.$iso_country.'/'.$iso_lang.'/')) != false)
$this->_list['addons'] = Tools::jsonDecode($json_content, true);
}
}