Hi, I'm trying to achive this result:
I have a table with some key/value (SKU/Quantity), by a some button I add a SKU Item to table.
Everything work fine, but If the SKU Item is in table I would like update the Quantity +1
TABLE:
| SKU | QTY |
|A01 | 10 |
|A02 | 5 |
with my button now I add another A01 how to change the right quantity cell?
- $("#comanda").find(".idart").each(function() {
-
- idPiatto = $(this).html();
-
- if (idPiatto === id) {
- trovato = true;
- riga = $(this).parent().parent();
- return false; //esco dall'each
-
- }
- i++;
-
- });
-
- if(trovato){
-
- var inputQuantita = $(riga).find(".qta");
-
- var totaleRiga = $(riga).find(".totale");
-
- var vecchioValore = parseInt($(inputQuantita).val());
-
- $(inputQuantita).val(vecchioValore + 1);
-
- qta = parseInt($(inputQuantita).val());
-
- totale = prezzo * qta;
-
- $(totaleRiga).val(totale);
-
-
- }
excuse for not traslate the variable :(