Grazie per la risposta, ma come faccio a settare con il codice che mi hai mandato queste due variabili?
totalamount e attributes.price. (inserisco sotto il codice del carrello)
cartstatus = function() {
totalamount = 0;
totalshipping = 25;
totalitems = 0;
for (i=0; i<=selecteditems.length-1; i++) {
if (isNaN(selecteditems[i].attributes.shipping) == false) {
totalamount += (Number(selecteditems[i].attributes.price) * Number(selecteditems[i].attributes.quantity));
totalshipping += (Number(selecteditems[i].attributes.shipping) * Number(selecteditems[i].attributes.quantity));
} else {
totalamount += (Number(selecteditems[i].attributes.price) * Number(selecteditems[i].attributes.quantity));
}
totalitems += Number(selecteditems[i].attributes.quantity);
}
if (selecteditems.length == 0) {
btn.txt.text = "0 articoli";
} else {
if (totalshipping > 0) {
btn.txt.text = currencysymbol + String(totalamount -(totalamount/100)*8) + " + " + currencysymbol + String(totalshipping) + " = " + currencysymbol + String(totalamount + totalshipping) + " " + String(totalitems) + " articoli";
} else {
btn.txt.text = currencysymbol + String(totalamount) + " " + String(totalitems) + " articoli";
}
}
}
cartstatus();
showmessagewin = function() {
hidemovie(messagewin);
messagewin = attachMovie("messagewindow", "messagewin" + String(getNextHighestDepth()), getNextHighestDepth());
showmovie(messagewin);
tip.swapDepths(getNextHighestDepth());
}
Grazie ancora

Rispondi quotando