Foros del Web » Creando para Internet » HTML »

Tabla con datos de simpleCart (javascript)

Estas en el tema de Tabla con datos de simpleCart (javascript) en el foro de HTML en Foros del Web. Buenas, tengo un problema con la libreria (simpleCart - http://simplecartjs.com/) Primero que nada si no es la sección correcta muevanlo por favor, me pareció que ...
  #1 (permalink)  
Antiguo 22/04/2012, 10:19
 
Fecha de Ingreso: junio-2010
Ubicación: Buenos Aires, Capital Federal
Mensajes: 29
Antigüedad: 13 años, 10 meses
Puntos: 0
Pregunta Tabla con datos de simpleCart (javascript)

Buenas, tengo un problema con la libreria (simpleCart - http://simplecartjs.com/)

Primero que nada si no es la sección correcta muevanlo por favor, me pareció que iba acá!

El problema que tengo es el siguiente, a la hora de mostrar el carro de compras (con los productos ya elegidos)

los productos se muestran así:

Nombre de Producto
Precio
Cantidad
Total

EJEMPLO:

remera re linda
$25.00
1
$25.50

Lo que yo necesito es que se muestre en una tabla de html:

Nombre Precio Cantidad Total
Remera $25.00 1 $25.50

en si mi problema principal es el tag html que printea los items es el sig:

Código HTML:
Ver original
  1. <div class="simpleCart_items"></div>

ese solo div printea los 4 items por lo cual no sé como usar los datos en una tabla.

por favor si me podrán dar una mano les agradezco!

Saludos
  #2 (permalink)  
Antiguo 19/10/2012, 14:33
 
Fecha de Ingreso: marzo-2012
Mensajes: 2
Antigüedad: 12 años, 1 mes
Puntos: 0
Respuesta: Tabla con datos de simpleCart (javascript)

Men debes colocar "table" en el parametro cartStyle! aqui esta como yo lo estoy tratando de usa y me funciona, pero yo quiero poder agragarle un codigo de producto, porque mi tienda es dinamica no estatica, por lo tanto los producto ya tiene sus codigos, y no encuentro la clase para que me tome ese codigo.... -.-'

Código:
<script>
		 simpleCart({

			// array representing the format and columns of the cart, see 
			// the cart columns documentation
			cartColumns: [
				{ attr: "name" , label: "Nombre" } ,
				{ attr: "price" , label: "Precio", view: 'currency' } ,
				{ view: "decrement" , label: false , text: "-" } ,
				{ attr: "quantity" , label: "N°" } ,
				{ view: "increment" , label: false , text: "+" } ,
				{ attr: "total" , label: "SubTotal", view: 'currency' } ,
				{ view: "remove" , text: "x" , label: false }
			],

			// "div" or "table" - builds the cart as a table or collection of divs
			cartStyle: "table", 

			// how simpleCart should checkout, see the checkout reference for more info 
			checkout: { 
				type: "SendForm" , 
				url:"http://localhost/pedidos/2.php?control=maestro_pedido&comprar=1",
				
						// http method for form, "POST" or "GET", default is "POST"
				method: "POST" ,

				success: "2.php" , 
				// url to return to on cancelled checkout, default is null
				cancel: "index.php" ,				
			},

			// set the currency, see the currency reference for more info
			currency: "BSF",

			// collection of arbitrary data you may want to store with the cart, 
			// such as customer info
			data: {},

			// set the cart langauge (may be used for checkout)
			language: "english-us",

			// array of item fields that will not be sent to checkout
			excludeFromCheckout: [],

			// custom function to add shipping cost
			shippingCustom: null,

			// flat rate shipping option
			shippingFlatRate: 0,

			// added shipping based on this value multiplied by the cart quantity
			shippingQuantityRate: 0,

			// added shipping based on this value multiplied by the cart subtotal
			shippingTotalRate: 0,

			// tax rate applied to cart subtotal
			taxRate: 9,

			// true if tax should be applied to shipping
			taxShipping: true,

			// event callbacks 
			beforeAdd               : null,
			afterAdd                : null,
			load                    : null,
			beforeSave              : null,
			afterSave               : null,
			update                  : null,
			ready                   : null,
			checkoutSuccess             : null,
			checkoutFail                : null,
			beforeCheckout              : null
		});
		</script>

Etiquetas: tabla
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:56.