From 62447dd1f1fe68818e27822eeec7f0d276c51405 Mon Sep 17 00:00:00 2001 From: Andre Cianfarani Date: Mon, 20 Mar 2006 15:53:57 +0000 Subject: [PATCH] debug --- htdocs/commande/commande.class.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 93777d950ec..a3b4a0c2f19 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -388,6 +388,7 @@ class Commande { if ($this->update_price() > 0) { + return 1; } else @@ -538,6 +539,7 @@ class Commande */ function add_product($idproduct, $qty, $remise_percent=0) { + global $conf; if ($idproduct > 0) { $i = sizeof($this->products); @@ -548,6 +550,25 @@ class Commande } $this->products_qty[$i] = $qty; $this->products_remise_percent[$i] = $remise_percent; + /** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS À LA COMMANDE + if($conf->global->PRODUIT_SOUSPRODUITS == 1) + { + $prod = new Product($this->db, $idproduct); + $prod -> get_sousproduits_arbo (); + $prods_arbo = $prod->get_each_prod(); + if(sizeof($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) + { + // print "id : ".$value[1].' :qty: '.$value[0].'
'; + if(! in_array($value[1],$this->products)) + $this->add_product($value[1], $value[0]); + + } + } + + } + **/ } }