In PrestaShop 1.3, 1.4 and 1.5 time and prices are incorrectly displayed under certain conditions depending on the server setup.
PrestaShop 1.3
In init.php
file.
Find:
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); setlocale(LC_COLLATE, $locale); setlocale(LC_CTYPE, $locale); setlocale(LC_TIME, $locale); setlocale(LC_NUMERIC, 'en_US.UTF-8');
Replace with:
/* Set locales */ $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY')); /* Please do not use LC_ALL here http://www.php.net/manual/fr/function.setlocale.php#25041 */ setlocale(LC_COLLATE, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_CTYPE, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_TIME, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_NUMERIC, 'en_US.UTF-8', 'en_US.utf8');
PrestaShop 1.4
In classes/FrontController.php
file.
Find:
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); setlocale(LC_COLLATE, $locale); setlocale(LC_CTYPE, $locale); setlocale(LC_TIME, $locale); setlocale(LC_NUMERIC, 'en_US.UTF-8');
Replace with:
/* Set locales */ $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY')); /* Please do not use LC_ALL here http://www.php.net/manual/fr/function.setlocale.php#25041 */ setlocale(LC_COLLATE, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_CTYPE, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_TIME, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_NUMERIC, 'en_US.UTF-8', 'en_US.utf8');
PrestaShop 1.5
In config/config.inc.php
file.
/* Set locales */ $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); setlocale(LC_COLLATE, $locale); setlocale(LC_CTYPE, $locale); setlocale(LC_TIME, $locale); setlocale(LC_NUMERIC, 'en_US.UTF-8');
Replace with:
/* Set locales */ $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY')); /* Please do not use LC_ALL here http://www.php.net/manual/fr/function.setlocale.php#25041 */ setlocale(LC_COLLATE, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_CTYPE, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_TIME, $locale.'.UTF-8', $locale.'.utf8'); setlocale(LC_NUMERIC, 'en_US.UTF-8', 'en_US.utf8');
PrestaShop 1.6 and later
There is nothing to fix – it’s already fixed.