| |||
Importe de un carrito Hola chicos soy nueva y por fin he descubierto como poner un tema sin enviar mensajes privados. Veréis he programado el típico carrito de la compra , pero mi problema es a la hora de calcular el importe, imagino que tendré que multiplicar la cantidad por el importe de cada una y que lo tendré que guardar en una variable $resul por ejemplo, pero realmente no se como acabar de implementarlo, porqu además he de añdir el IVA y una tarifa de envío. Bueno espero que me puedana yudar gracias de verdad. |
| |||
Re: Importe de un carrito <?php include ( "php/includes/Constants.php" ) ; include ( "php/includes/Function.php" ) ; include ( "php/classes/class.DB.php" ) ; include ( "php/classes/class.productes.php") ; include ( "php/classes/class.cistella.php") ; include ( "php/classes/class.comandes.php"); include ( "php/classes/class.clients.php"); include ( "php/classes/class.visitants.php"); $Productes = new Productes(DB_USER, DB_PASS, DB_NAME, DB_HOST) ; $Cistella = new Cistella(DB_USER, DB_PASS, DB_NAME, DB_HOST) ; $Comandes = new Comandes(DB_USER, DB_PASS, DB_NAME, DB_HOST) ; $DB = new DB(DB_USER, DB_PASS, DB_NAME, DB_HOST) ; $Clients= new Clients(DB_USER, DB_PASS, DB_NAME, DB_HOST) ; $Visitants = new Visitants (DB_USER, DB_PASS, DB_NAME, DB_HOST) ; ?> <html> <head> <title>Moss Productos Plasticos</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="estilo.css" type="text/css"> </head> <body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF"> <form name="form1" method="post" action=""> </form> <table border="0" cellspacing="0" cellpadding="0" height="475"> <tr> <td rowspan="17" width="20" height="475"> <img src="img/usuari.jpg" width="24" height="24" vspace="0" hspace="0"></td> <td colspan="5" height="12"></td> </tr> <tr> <td colspan="5" class="texto" height="20" valign="top"><b>Carrito de la compra |</b> Tu Pedido</td> </tr> <tr> <td class="texto" colspan="5" height="35" valign="top"> <p> <font color="#0000FF">Si no eres cliente haz click <a href="visitant.php?Add=<?php echo($_SESSION["sPedidoId"])?>" target="mainFrame" class="textoenl">aquí</a> para registrarte</font></td> </tr> <tr> <td colspan="5" height="35" valign="top"> <p><u><font color="#0000FF"> Si eres cliente:</font></u></p> <p>Login <font color="#0000FF"> </font> <input type="text" name="clave" class="c50" size="10"> </td> </tr> <td colspan="3" width="15" height="23"></td> </tr> <tr> <td colspan="5" height="182" valign="top"> <table border="0" cellspacing="4" cellpadding="0"> <tr> <td class="texto" height="20" valign="top" width="45"><b> Ref.</b></td> <td class="texto" height="20" valign="top" width="295"><b>Producto</b></td> <td class="texto" width="35" height="20" valign="top" align="center"><b>Bolsa</b></td> <td class="texto" width="80" align="center" valign="top"><b>Precio|Euros</b></td> </tr> <?php $WHERE = " WHERE cis_com_codi = '".$_SESSION["sPedidoId"]."'" ; $Cistella->Select($WHERE); while($Cistella->fetchRow()){ ?> <tr> <td bgcolor="#F3F3F3" class="texto" align="center" height="20"><?php echo($Cistella->record["cis_pro_codi"]); ?></td> <td bgcolor="#F3F3F3" class="texto"><?php echo($Cistella->record["cis_pro_nom"]);?></td> <td bgcolor="#F3F3F3" class="texto" align="center"><?php echo($Cistella->record["cis_pro_quantitat"]); ?></td> <td bgcolor="#F3F3F3" class="texto" align="center"><?php echo($Cistella->record["cis_pro_preu"]); ?></td> </td> </tr> <?php } ?> <tr> <td colspan="5" height="5"></td> </tr> <tr> <td class="texto" height="16" colspan="3"> Total cesta</td> <td align="center"> <table width="76" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="texto" align="right" width="46">225698,38</td> </tr> </table> </td> <td class="texto">€</td> </tr> <tr> <td class="texto" height="16" colspan="3"> Total envio</td> <td align="center"> <table width="76" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="texto" align="right" width="46">2258,16</td> </tr> </table> </td> <td class="texto">€</td> </tr> <tr> <td class="texto" height="16" colspan="3"><b> Total pedido</b></td> <td align="center"> <table width="76" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="texto" align="right" width="46"><b>243258,16</b></td> </tr> </table> </td> <td class="texto">€</td> </tr> <tr> <td colspan="5" align="left"> <table width="112" border="0" cellspacing="0" cellpadding="1" bgcolor="#666666"> <tr> <td> <table cellspacing="0" cellpadding="0" width="100%" border="0" height="14"> <tr> <td align="center" bgcolor="#E1E1E1" valign="middle"><a href="mensok.html" target="mainframe"> <input type="image" border="0" src="img/enviar.gif" width="34" height="9"></a></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <br> </form> </body> </html> |