Ver Mensaje Individual
  #11 (permalink)  
Antiguo 15/04/2005, 05:58
Gux
 
Fecha de Ingreso: octubre-2003
Mensajes: 58
Antigüedad: 20 años, 6 meses
Puntos: 0
Cluster, creo que me voy acercando pero aun no sale. Te comento lo que me pasa ahora. No me hace el for, sólo me manda " algunos datos" del último articulo del pedido ( $descuento y $importe) mientras que el resto de las variables me las pinta como Array[1] (para un pedido de dos articulos)

Te adjunto el codigo de la function:

Código PHP:
//Muestra el contenido del carrito para el mail
    
function imprime_carro(){

    
             for (
$i=0;$i<$this->num_productos;$i++){
            if(
$this->array_id_prod[$i]!=0){

                if(
$this->array_familia_prod[$i]=='Material Oficina')
                {

          if(
$this->array_cantidad_prod[$i]<=1)
                {
                    
$descuento='0';
                }
                else if(
$this->array_cantidad_prod[$i]>=and $this->array_cantidad_prod[$i]<=4)
                {
                    
$descuento='2';
                }
                else if(
$this->array_cantidad_prod[$i]>=and $this->array_cantidad_prod[$i]<=9)
                {
                    
$descuento='4';
                }
                else if(
$this->array_cantidad_prod[$i]>=10 and $this->array_cantidad_prod[$i]<=18)
                {
                    
$descuento='8';
                }
                else if(
$this->array_cantidad_prod[$i]>=19 and $this->array_cantidad_prod[$i]<=24)
                {
                    
$descuento='10';
                }
                else if(
$this->array_cantidad_prod[$i]>=25 and $this->array_cantidad_prod[$i]<=35)
                {
                    
$descuento='11';
                }
                else if(
$this->array_cantidad_prod[$i]>=36)
                {
                    
$descuento='15';
                }

                }
                else
                {
                
                
$descuento='0';
                }

        
$html"<tr>
                 <td class='txt3p' height='30'> $this->array_familia_prod[$i] </td>
                 <td class='txt3p' height='30'> $this->array_producto_prod[$i] </td>
                 <td class='txt3p' height='30'> $this->array_referencia_prod[$i] </td>
                 <td class='txt3p' height='30'> $this->array_articulo_prod[$i] </td>
                 <td class='txt3p' height='30' align='center'> $this->array_precio_prod[$i] </td>
                 <td class='txt3p' height='30' align='center'> $this->array_cantidad_prod[$i] </td>
                 <td class='txt3p' height='30'><center>$descuento %</center></td>"
;

                
$rebaja $descuento/100;
                
$desc =  $this->array_precio_prod[$i]*$this->array_cantidad_prod[$i]*$rebaja;
                
$importe round($this->array_precio_prod[$i]*$this->array_cantidad_prod[$i]-$desc,2);


         
$html .="<td class='txt3p' height='30'><center>$importe €</center></td>
                </tr>
                <tr>
                <td height='10' class='px' colspan='9'>
                </td>
                </tr>
                <tr>
                 <td width='545' bgcolor='#164D89' height='1' class='px' colspan='9'>
                 </td>
                </tr>"
;
            }
        }

        return 
$html

    } 

¿Qué puede fallar?

Gracias