"Primerillo" de fila

TABLÓN

  • TABLON
  • RECURSOS WEB
  • TIENDA ON LINE

lunes, 17 de octubre de 2011

prueba

Publicado por SusanG en 12:38 No hay comentarios:
Enviar por correo electrónicoEscribe un blogCompartir en XCompartir con FacebookCompartir en Pinterest
Entradas más recientes Entradas antiguas Inicio
Suscribirse a: Entradas (Atom)

ÍNDICE

  • ATENCIÓN A LA DIVERSIDAD (1)

LISTA DE BLOGS

  • MARÍA LUQUE

Seguidores

Archivo del blog

  • ▼  2011 (1)
    • ▼  octubre (1)
      • prueba
  • ►  2010 (1)
    • ►  octubre (1)
this.quantity = 0; /* retrieve item data from cookie */ if( readCookie('simpleCart') ){ var data = unescape(readCookie('simpleCart')).split('++'); for(var x=0, xlen=data.length;x 0 ){ this.updateCartView(); } }; this.updateViewTotals = function() { var outlets = [ ["quantity" , "none" ] , ["total" , "currency" ] , ["shippingCost" , "currency" ] , ["taxCost" , "currency" ] , ["taxRate" , "percentage" ] , ["finalTotal" , "currency" ] ]; for( var x=0,xlen=outlets.length; x"; } }; this.valueToTextInput = function( value , html ){ return ""; }; this.valueToLink = function( value, link, html){ return "" + value + ""; }; this.valueToElement = function( type , value , html ){ return "<" + type + " " + html + " > " + value + ""; }; /****************************************************** Duplicate management ******************************************************/ this.hasItem = function ( item ) { for( var current in this.items ) { var testItem = this.items[current]; var matches = true; for( var field in item ){ if( typeof( item[field] ) != "function" && field != "quantity" && field != "id" ){ if( item[field] != testItem[field] ){ matches = false; } } } if( matches ){ return current; } } return false; }; /****************************************************** Cart Update managment ******************************************************/ this.update = function() { if( !simpleCart.isLoaded ){ simpleCart.load(); } if( !simpleCart.pageIsReady ){ simpleCart.initializeView(); } this.updateTotals(); this.updateView(); this.save(); }; this.updateTotals = function() { this.total = 0 ; this.quantity = 0; for( var current in this.items ){ var item = this.items[current]; if( item.quantity < 1 ){ item.remove(); } else if( item.quantity !== null && item.quantity != "undefined" ){ this.quantity = parseInt(this.quantity,10) + parseInt(item.quantity,10); } if( item.price ){ this.total = parseFloat(this.total) + parseInt(item.quantity,10)*parseFloat(item.price); } } this.shippingCost = this.shipping(); this.taxCost = parseFloat(this.total)*this.taxRate; this.finalTotal = this.shippingCost + this.taxCost + this.total; }; this.shipping = function(){ if( parseInt(this.quantity,10)===0 ) return 0; var shipping = parseFloat(this.shippingFlatRate) + parseFloat(this.shippingTotalRate)*parseFloat(this.total) + parseFloat(this.shippingQuantityRate)*parseInt(this.quantity,10), nextItem, next; for(next in this.items){ nextItem = this.items[next]; if( nextItem.shipping ){ if( typeof nextItem.shipping == 'function' ){ shipping += parseFloat(nextItem.shipping()); } else { shipping += parseFloat(nextItem.shipping); } } } return shipping; } this.initialize = function() { simpleCart.initializeView(); simpleCart.load(); simpleCart.update(); }; } /******************************************************************************************************** * Cart Item Object ********************************************************************************************************/ function CartItem() { this.id = "c" + NextId++; } CartItem.prototype.set = function ( field , value ){ field = field.toLowerCase(); if( typeof( this[field] ) != "function" && field != "id" ){ if( field == "quantity" ){ value = value.replace( /[^(\d|\.)]*/gi , "" ); value = value.replace(/,*/gi, ""); value = parseInt(value,10); } else if( field == "price"){ value = value.replace( /[^(\d|\.)]*/gi, ""); value = value.replace(/,*/gi , ""); value = parseFloat( value ); } if( typeof(value) == "number" && isNaN( value ) ){ error( "Improperly formatted input."); } else { this[field] = value; this.checkQuantityAndPrice(); } } else { error( "Cannot change " + field + ", this is a reserved field."); } simpleCart.update(); }; CartItem.prototype.increment = function(){ this.quantity = parseInt(this.quantity,10) + 1; simpleCart.update(); }; CartItem.prototype.decrement = function(){ if( parseInt(this.quanity,10) < 2 ){ this.remove(); } else { this.quantity = parseInt(this.quantity,10) - 1; simpleCart.update(); } }; CartItem.prototype.print = function () { var returnString = ''; for( var field in this ) { if( typeof( this[field] ) != "function" ) { returnString+= escape(field) + "=" + escape(this[field]) + "||"; } } return returnString.substring(0,returnString.length-2); }; CartItem.prototype.checkQuantityAndPrice = function() { if( !this.price || this.quantity == null || this.quantity == 'undefined'){ this.quantity = 1; error('No quantity for item.'); } else { this.quantity = ("" + this.quantity).replace(/,*/gi, "" ); this.quantity = parseInt( ("" + this.quantity).replace( /[^(\d|\.)]*/gi, "") , 10); if( isNaN(this.quantity) ){ error('Quantity is not a number.'); this.quantity = 1; } } if( !this.price || this.price == null || this.price == 'undefined'){ this.price=0.00; error('No price for item or price not properly formatted.'); } else { this.price = ("" + this.price).replace(/,*/gi, "" ); this.price = parseFloat( ("" + this.price).replace( /[^(\d|\.)]*/gi, "") ); if( isNaN(this.price) ){ error('Price is not a number.'); this.price = 0.00; } } }; CartItem.prototype.parseValuesFromArray = function( array ) { if( array && array.length && array.length > 0) { for(var x=0, xlen=array.length; x
Tema Sencillo. Imágenes del tema: linearcurves. Con la tecnología de Blogger.