From df1e423c9c7ad43b76647187cd2b2b6a3d7816cc Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Mon, 11 Jul 2016 17:06:11 +0200 Subject: [PATCH] modif order way --- modules/privatesales/Sale.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/privatesales/Sale.php b/modules/privatesales/Sale.php index e0156042..0164c0ac 100755 --- a/modules/privatesales/Sale.php +++ b/modules/privatesales/Sale.php @@ -935,15 +935,16 @@ class Sale { if ($multi_only) { return $order_print; } else { - // tri par date pour les M2+ - // sort($order_print); - usort($order_print, function ($a, $b) { - if ($_nb_product[$a] == $_nb_product[$b]) { - return 0; - } - return ($_nb_product[$a] < $_nb_product[$b]) ? -1 : 1; - }); - return $order_print; + asort($_nb_product); + $result_to_print = array(); + foreach ($_nb_product as $key => $value) { + if (in_array($key,$order_print)) { + $result_to_print[]=$key; + } else { + continue; + } + } + return $result_to_print; } return $order_print;