[Ian Davila]
No registrado
De: N/A
Mensajes: N/A
|
 |
Confirmacion de agregar al carrito |
|
| Enviado: 09-07-2002 21:02 |
| |
 |
El foro es cerrado |
|
|
Fede... estaba checando la pagina pcenlinea.com, la cual cuando agregabas un producto al carrito aparecia en la barra negra superior el numero de productos y el costo total que llevaban esos art que estaban en el carrito, eso se podria hacer?
Saludos
Has de decir que como doy lata verdad?
|
Federico
Administrador

De: Argentina
Mensajes: 171
|
 |
Confirmacion de agregar al carrito |
|
| Enviado: 10-07-2002 » Contacto |
| |
 |
El foro es cerrado |
|
|
Mmm, me fijé en ese sitio y no ví nada nuevo. O sea, si vos haces click en "Estado", también ves los productos, cantidades, unidades y el total.
Saludos,
Federico Cargnelutti
[email protected]
|
[Ian Davila]
No registrado
De: N/A
Mensajes: N/A
|
 |
Confirmacion de agregar al carrito |
|
| Enviado: 10-07-2002 20:59 |
| |
 |
El foro es cerrado |
|
|
o una posible venta que pueda aparecer despues que le das aceptar, que diga " Tu producto a sido agregado satisfactoriamente"
Gracias FEDE
|
Federico
Administrador

De: Argentina
Mensajes: 171
|
 |
Confirmacion de agregar al carrito |
|
| Enviado: 11-07-2002 » Contacto |
| |
 |
El foro es cerrado |
|
|
Ok 
Saludos,
Federico Cargnelutti
[email protected]
|
Federico
Administrador

De: Argentina
Mensajes: 171
|
 |
Confirmacion de agregar al carrito |
|
| Enviado: 11-07-2002 » Contacto |
| |
 |
El foro es cerrado |
|
|
Bueno listo, fijate que acá hay un ejemplo Enlace. En la parte inferior del carrito, dice:
Productos: 0 Total: $ 0
A medida que vas agregando productos, los números incrementan. Esto lo podes incluir en cualquier parte de la página.
1) Cambiá el javascript que se encuentra en la página "carrito.html" por este:
Citar:
<script LANGUAGE="JavaScript">
index = document.cookie.indexOf("TheBasket");
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
fulllist = document.cookie.substring(countbegin, countend);
totprice = 0;
itemlist = 0;
for (var i = 0; i <= fulllist.length; i++) {
if (fulllist.substring(i,i+1) == '[') {
itemstart = i+1;
} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
totprice = totprice + itemtotal;
itemlist=itemlist+1;
} else if (fulllist.substring(i,i+1) == ',') {
theitem = fulllist.substring(itemstart, i);
itemstart = i+1;
} else if (fulllist.substring(i,i+1) == '#') {
theprice = fulllist.substring(itemstart, i);
itemstart = i+1;
}
}
function buyItem(newItem, newPrice, newQuantity) {
if (newQuantity <= 0) {
rc = alert('La cantidad ingresada es incorrecta');
return false;
}
if (confirm('¿Agregar '+newQuantity+' '+newItem+' al carrito?')) {
index = document.cookie.indexOf("TheBasket");
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+","+newPrice+"#"+newQuantity+"]";
window.location.reload();
}
return true;
}
function resetShoppingBasket() {
index = document.cookie.indexOf("TheBasket");
document.cookie="TheBasket=.";
}
</script>
Y donde querés que figure el total y el valor de los productos agregá este script:
Citar:
<script LANGUAGE="JavaScript">
document.writeln('<TABLE>');
document.writeln('<tr><td colspan=3><b>Productos</b>: '+itemlist+'</td><td align=right> <b>Total</b>: $ '+totprice+'</td>');
document.writeln('</TABLE>');
</script>
Lo que hice para que no se te abra una ventana cada vez que agregás un producto, es refrescar la página. De esa manera el usuario se da cuenta que el producto fue agregado al carrito. Cualquier duda fijate en el código fuente del enlace que te dejé arriba.
Saludos,
Federico Cargnelutti
[email protected]
|
[Ian Davila]
No registrado
De: N/A
Mensajes: N/A
|
 |
Confirmacion de agregar al carrito |
|
| Enviado: 12-07-2002 15:54 |
| |
 |
El foro es cerrado |
|
|
Fede...
La verdad eres increible para esto deja lo pruebo y te aviso q onda. trate de escribirte el mail como me dijiste pero el servidor me los sigue rebotando que hago?
saludos
|