diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5a7990cd0a7..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 (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); } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 69c872c51a4..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)).''; @@ -680,7 +681,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; }