From 524aa9688003944c275f2650fd8496d7eb7738ae Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 19 Nov 2020 14:14:43 +0100 Subject: [PATCH 1/2] FIX to preserve order of multiprices fields --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d4ab94d9c2f..9794e218585 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -237,7 +237,7 @@ if ($conf->global->PRODUIT_MULTIPRICES) { } else { $labelp = $langs->trans("SellingPrice")." ".$i; } - $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>40); + $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>'40.'.$i); $arraypricelevel[$i] = array($i); } } From 265d19f5639928e36c40cbc52cc7d280c50e278b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 20 Nov 2020 08:07:44 +0100 Subject: [PATCH 2/2] FIX better method to preserve order --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 9794e218585..b1dbb2609e1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -237,7 +237,7 @@ if ($conf->global->PRODUIT_MULTIPRICES) { } else { $labelp = $langs->trans("SellingPrice")." ".$i; } - $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>'40.'.$i); + $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>floatval('40.'.sprintf('%03s', $i))); $arraypricelevel[$i] = array($i); } }