Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Applicare uno sconto al totale di un carrello

    Ciao a tutti,
    devo applicare uno sconto dell' 8% ad un valore calcolato dinamicamente. Precisamente ad un carrello creato in actionscript.
    Il codice è il seguente :

    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) + " + " + 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());
    }

    Lo sconto va applicato al totale del carrello prima dell'aggiunta delle spese di spedizioni (totalshipping)
    C'è qualcuno che può darmi una mano?
    Grazie anticipatamente a tutti
    ________________________
    www.mdsite.ws
    domenico@mdsite.ws

  2. #2

    RISOLTO!!!!!!!!

    RISOLTO!!!!!!!!
    ________________________
    www.mdsite.ws
    domenico@mdsite.ws

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.