This commit is contained in:
Andre Cianfarani 2006-03-20 15:53:57 +00:00
parent 35fb0dda9f
commit 62447dd1f1

View File

@ -388,6 +388,7 @@ class Commande
{ {
if ($this->update_price() > 0) if ($this->update_price() > 0)
{ {
return 1; return 1;
} }
else else
@ -538,6 +539,7 @@ class Commande
*/ */
function add_product($idproduct, $qty, $remise_percent=0) function add_product($idproduct, $qty, $remise_percent=0)
{ {
global $conf;
if ($idproduct > 0) if ($idproduct > 0)
{ {
$i = sizeof($this->products); $i = sizeof($this->products);
@ -548,6 +550,25 @@ class Commande
} }
$this->products_qty[$i] = $qty; $this->products_qty[$i] = $qty;
$this->products_remise_percent[$i] = $remise_percent; $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].'<br>';
if(! in_array($value[1],$this->products))
$this->add_product($value[1], $value[0]);
}
}
}
**/
} }
} }