From 550c57d53ed1760f31811efc51cf459c956d0671 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Mon, 27 Jun 2022 08:45:38 +0200 Subject: [PATCH 1/4] FIX - php V8 composition card --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 69c872c51a4..8c4c407364f 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -680,7 +680,7 @@ if ($id > 0 || !empty($ref)) { print ''.$productstatic->getNomUrl(1, '', 24).''; $labeltoshow = $objp->label; - if ($conf->global->MAIN_MULTILANGS && $objp->labelm) { + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->labelm)) { $labeltoshow = $objp->labelm; } From ebe8e34249f10bcfba4d9a44a3c59058e19af58d Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Mon, 27 Jun 2022 08:49:27 +0200 Subject: [PATCH 2/4] total init --- htdocs/product/composition/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 8c4c407364f..bc6a1c36628 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -380,6 +380,7 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; $totalsell = 0; + $total = 0; if (count($prods_arbo)) { foreach ($prods_arbo as $value) { $productstatic->fetch($value['id']); @@ -418,7 +419,7 @@ if ($id > 0 || !empty($ref)) { $unitline = price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MU'); $totalline = price2num($value['nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MT'); - $total += $totalline; + $total += $totalline; print ''; print ($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '').''.price($unitline, '', '', 0, 0, -1, $conf->currency)).''; From f3b3e97d4949878c3557f2bf12a1fe6a01d8d488 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Mon, 27 Jun 2022 08:51:12 +0200 Subject: [PATCH 3/4] Recursive call if there is childs to child --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5a7990cd0a7..f3ba9692d52 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4633,7 +4633,7 @@ class Product extends CommonObject ); // Recursive call if there is childs to child - if (is_array($desc_pere['childs'])) { + if (isset($desc_pere['childs']) and is_array($desc_pere['childs'])) { //print 'YYY We go down for '.$desc_pere[3]." -> \n"; $this->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1] * $multiply, $level + 1, $id, $ignore_stock_load); } From 834d12963429c3a035231a68f0a127c2f82c8006 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jun 2022 11:11:43 +0200 Subject: [PATCH 4/4] Update product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f3ba9692d52..01d401e384d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4633,7 +4633,7 @@ class Product extends CommonObject ); // Recursive call if there is childs to child - if (isset($desc_pere['childs']) and is_array($desc_pere['childs'])) { + if (isset($desc_pere['childs']) && is_array($desc_pere['childs'])) { //print 'YYY We go down for '.$desc_pere[3]." -> \n"; $this->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1] * $multiply, $level + 1, $id, $ignore_stock_load); }