JAVLLAR Posted February 9, 2009 Share Posted February 9, 2009 HIAny ideas how to order language icons in prestashop store?Thanks Link to comment Share on other sites More sharing options...
Laci Posted February 11, 2011 Share Posted February 11, 2011 HIAny ideas how to order language icons in prestashop store?Thanks Hi,probably you have solved it yourself, but in case somebody else needs a solution, this can be useful:in the /module/blocklanguages/blocklanguages.php file putfunction cmp($a, $ { //language iso_code in the desired order: $new_order = array("fr", "es", "en", "de"); foreach($new_order as &$value) { if ($a["iso_code"]==$value) return -1; if ($b["iso_code"]==$value) return 1; } } usort($languages,"cmp"); right before the following line: $smarty->assign('languages', $languages); I tested it in prestashop 1.3.5Cheers,Laci 1 Link to comment Share on other sites More sharing options...
Berlindoor Posted November 4, 2011 Share Posted November 4, 2011 thanks Link to comment Share on other sites More sharing options...
Noemi88 Posted July 1, 2012 Share Posted July 1, 2012 Thanks a lot! it's works! Link to comment Share on other sites More sharing options...
[email protected] Posted December 7, 2012 Share Posted December 7, 2012 (edited) Any Idea How to do same in 1.5.1 Edited December 7, 2012 by [email protected] (see edit history) Link to comment Share on other sites More sharing options...
entr Posted April 7, 2013 Share Posted April 7, 2013 (edited) Turns out in 1.5 $languages assignment has been moved to FrontController.php, so you need to usort the array in overrides. Edited April 7, 2013 by entr (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted October 3, 2013 Share Posted October 3, 2013 For PS 1.5.4.1 I override the following class in classes/Language.php: public static function getLanguages($active = true, $id_shop = false) { if (!self::$_LANGUAGES) Language::loadLanguages(); $languages = array(); foreach (self::$_LANGUAGES as $language) { if ($active && !$language['active'] || ($id_shop && !isset($language['shops'][(int)$id_shop]))) continue; $languages[] = $language; } usort($languages, function($a, $ { //language iso_code in the desired order: $new_order = array("es", "en"); foreach($new_order as &$value) { if ($a["iso_code"]==$value) return -1; if ($b["iso_code"]==$value) return 1; } }); return $languages; } 1 Link to comment Share on other sites More sharing options...
Recommended Posts