[-] FO : standardize behavior of selected country in the list when create a new address
This commit is contained in:
1 parent
f43aee9a25
commit
7a27fa2f64
1 file changed
+11
-2
@@ -104,12 +104,21 @@ class AuthControllerCore extends FrontController
|
|||||||
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
|
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
|
||||||
else
|
else
|
||||||
$countries = Country::getCountries($this->context->language->id, true);
|
$countries = Country::getCountries($this->context->language->id, true);
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||||
|
{
|
||||||
|
$array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
|
if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0])))
|
||||||
|
$sl_country = (int)Configuration::get('PS_COUNTRY_DEFAULT');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$sl_country = (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'inOrderProcess' => true,
|
'inOrderProcess' => true,
|
||||||
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
|
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
|
||||||
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
|
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
|
||||||
'sl_country' => (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')),
|
'sl_country' => (int)$sl_country,
|
||||||
'countries' => $countries
|
'countries' => $countries
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user