Andromeda100 Posted February 7, 2009 Share Posted February 7, 2009 I've install this contribution http://www.oscommerce.com/community/contri...arch,happy+hour generelly it works fine but when you put a article over 1000 euros to the shopping cart, the price isn't correct. prices under 1000 euro make any problems. i think that the mistake is in the formular.js in includes/ but i don't have an answer function startPriceCounter() { setInterval("UpdatePrice()",100); } function formatCurrencies( PreisVar) { var Dezimalstellen = "2"; // var Dezimalpunkt = ","; var Dezimalpunkt = "."; // var Dezimalzeichen = "."; var Dezimalzeichen = ","; if ( Dezimalstellen.length > 0) { if ( Dezimalpunkt.length > 0 && Dezimalzeichen.length > 0) { ValueZurueck = ""; pos = PreisVar.indexOf("."); if (pos > 0) { PreisKomma = PreisVar.substring( 0, pos); Kommapos = PreisVar.substring( pos + 1, PreisVar.length); } else { PreisVar = PreisVar + ".00"; pos = PreisVar.indexOf("."); PreisKomma = PreisVar.substring( 0, pos); Kommapos = PreisVar.substring( pos + 1, PreisVar.length); } if ( PreisKomma.length > 3) { ZeitderSich = Math.floor(PreisKomma.length/3); nachStart = PreisKomma.length % 3; ValueDerSich = PreisKomma; if (nachStart > 0) { ValueZurueck = PreisKomma.substring( 0, nachStart) + Dezimalzeichen; ValueDerSich = PreisKomma.substring( nachStart, PreisKomma.length); } while ( ValueDerSich.length > 0) { if ( ValueDerSich.length > 3) ValueZurueck = ValueZurueck + Dezimalzeichen + ValueDerSich.substring(0, 3); else ValueZurueck = ValueZurueck + ValueDerSich.substring(0, 3); ValueDerSich = ValueDerSich.substring(3, ValueDerSich.length); } ValueZurueck = ValueZurueck + Dezimalpunkt + Kommapos.substring( 0, parseInt(Dezimalstellen)); } else { ValueZurueck = PreisKomma + Dezimalpunkt + Kommapos.substring( 0, parseInt(Dezimalstellen)); } return ValueZurueck; } else if ( Dezimalpunkt.length > 0 && Dezimalzeichen.length == 0) { ValueZurueck = ""; pos = PreisVar.indexOf("."); if (pos > 0) { PreisKomma = PreisVar.substring( 0, pos); Kommapos = PreisVar.substring( pos + 1, PreisVar.length); } else { PreisVar = PreisVar + ".00"; pos = PreisVar.indexOf("."); PreisKomma = PreisVar.substring( 0, pos); Kommapos = PreisVar.substring( pos + 1, PreisVar.length); } ValueZurueck = PreisKomma + Dezimalpunkt + Kommapos.substring( 0, parseInt(Dezimalstellen)); return ValueZurueck; } } return PreisVar; } // function UpdatePrice() { var flash = document.getElementById("flash"); var lprice1 = document.getElementById("StartPrice"); var lprice2 = document.getElementById("EndPrice"); if ( flash != null && ( EndPrice < PriceVar) && ZaehlStop == false ) { PriceVar = PriceVar - Vprice; if ( PriceVar < EndPrice ) PriceVar = EndPrice; str = PriceVar + ""; pcprice = str; str = formatCurrencies(str); pos = pcprice.indexOf(","); pcprice = pcprice.substring(0,(pos+3)); flash.value = str; if (lprice1 != null) lprice1.value = pcprice; if (lprice2 != null) lprice2.value = pcprice; if ( PriceVar <= EndPrice) document.location.reload(); } } function startSynchron() { setInterval("loadScript()",10000); } // function loadScript() { if (!ZaehlStop) { var sec = new Date(); var url = "&cur=" + 0 + "&" + sec.getTime(); var e = document.createElement("script"); e.src = url; e.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(e); } } i hope somebody can help me to find a solution. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.