From 3027ed48c195e23e451dceaaddf32c55618bc3bb Mon Sep 17 00:00:00 2001 From: thibdrev Date: Sat, 27 Apr 2024 00:49:58 +0200 Subject: [PATCH] qual: Variants - cleaner code and improved attributes readability (#29505) * clean code * phpcs --- htdocs/variants/combinations.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index b0d95a83337..fa0e4cd2ea0 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -928,14 +928,8 @@ if (!empty($id) || !empty($ref)) { print ''.$prodstatic->getNomUrl(1).''; print ''; - $productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id); - $iMax = count($productCombination2ValuePairs); - - for ($i = 0; $i < $iMax; $i++) { - echo dol_htmlentities($productCombination2ValuePairs[$i]); - if ($i !== ($iMax - 1)) { - echo ', '; - } + foreach ($comb2val->fetchByFkCombination($currcomb->id) as $pc2v) { + print dol_htmlentities($pc2v).'
'; } print ''; print ''.($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '').'';