Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/12/2014, 12:56
eslomao
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
carrito de compras

pues eso, tengo un lio con esto, lo tengo casi terminado, pero... en el tema de como comprar no lo consigo arreglar, he mirado miles de codigo, pero no los entiendo bien, es decir, en una pagina compra, en otra aparece el producto/s comprado/s, con el iva y todo, pero... a la hora de confirmar esa compra no se como llevarme esos datos y confirmar la compra, os dejo el codigo a ver si me podeis ayudar, hasta ahora siempre lo haceis,
aqui ha recogido los datos , precios iva y el total

Código PHP:
Ver original
  1. <?php
  2. if (!function_exists("GetSQLValueString")) {
  3. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  4. {
  5.   if (PHP_VERSION < 6) {
  6.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.   }
  8.  
  9.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  10.  
  11.   switch ($theType) {
  12.     case "text":
  13.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  14.       break;    
  15.     case "long":
  16.     case "int":
  17.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  18.       break;
  19.     case "double":
  20.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  21.       break;
  22.     case "date":
  23.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  24.       break;
  25.     case "defined":
  26.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  27.       break;
  28.   }
  29.   return $theValue;
  30. }
  31. }
  32.  
  33. $varUsuario_DatosCarrito = "0";
  34. if (isset($_SESSION["MM_IdUsuario"])) {
  35.   $varUsuario_DatosCarrito = $_SESSION["MM_IdUsuario"];
  36. }
  37. mysql_select_db($database_conexionzapatos, $conexionzapatos);
  38. $query_DatosCarrito = sprintf("SELECT * FROM tblcarrito WHERE tblcarrito.idUsuario = %s AND tblcarrito.intTransaccionEfectuada = 0", GetSQLValueString($varUsuario_DatosCarrito, "int"));
  39. $DatosCarrito = mysql_query($query_DatosCarrito, $conexionzapatos) or die(mysql_error());
  40. $row_DatosCarrito = mysql_fetch_assoc($DatosCarrito);
  41. $totalRows_DatosCarrito = mysql_num_rows($DatosCarrito);
  42. ?>
  43.  <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tabla">
  44.                   <tr>
  45.                     <td>Producto</td>
  46.                     <td>Unidades</td>
  47.                     <td>Precio</td>
  48.                     <td>Acciones</td>
  49.                   </tr>
  50.                   <?php $preciototal = 0;?>
  51.                   <?php do { ?>
  52.   <tr>
  53.     <td><?php echo ObtenerNombreProducto($row_DatosCarrito['idProducto']); ?></td>
  54.     <td><?php echo $row_DatosCarrito['intCantidad']; ?></td>
  55.     <td><?php echo ObtenerPrecioProducto($row_DatosCarrito['idProducto']); ?> Euros</td>
  56.     <td><a href="eliminar_producto.php?recordID=<?php echo $row_DatosCarrito['idProducto']; ?>">Eliminar</a></td>
  57.   </tr>
  58. <?php   $preciototal = $preciototal + ObtenerPrecioProducto($row_DatosCarrito['idProducto']);?>
  59.   <?php } while ($row_DatosCarrito = mysql_fetch_assoc($DatosCarrito)); ?>
  60.         <tr>
  61.     <td>&nbsp;</td>
  62.     <td align="right">Subtotal:</td>
  63.     <td><?php echo $preciototal; ?> Euros</td>
  64.     <td>&nbsp;</td>
  65.   </tr>
  66.         <tr>
  67.           <td>&nbsp;</td>
  68.           <td align="right">IVA:</td>
  69.           <td><?php echo ObtenerIVA(); ?>%</td>
  70.           <td>&nbsp;</td>
  71.         </tr>
  72.         <tr>
  73.           <td>&nbsp;</td>
  74.           <td align="right">Valor del IVA:</td>
  75.           <td><?php
  76.           $multiplicador =  ObtenerIVA()/100;
  77.           $valordelIVA = $preciototal * $multiplicador;
  78.           echo $valordelIVA;?> Euros</td>
  79.           <td>&nbsp;</td>
  80.         </tr>
  81.         <tr>
  82.           <td>&nbsp;</td>
  83.           <td align="right">Total con IVA:</td>
  84.           <td><?php
  85.           $multiplicador =  (100 + ObtenerIVA())/100;
  86.           $valorconIVA = $preciototal * $multiplicador;
  87.           echo $valorconIVA;?> Euros</td>
  88.           <td>&nbsp;</td>
  89.         </tr>
  90.                 </table>
  91.                
  92.                 <a href="carrito_forma_pago.php">Seleccionar Forma de Pago</a>
  93.                 </div>
  94.    
  95.     </div>
  96.  
  97. </body>
  98. </html>
  99.  
  100. <?php
  101. mysql_free_result($DatosCarrito);

tengo creada otra pagina, pero no se como recoger estos datos, y mandarlos a por ejemplo paypal,