JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<table cellspacing="0" class="group_table">
<tbody>
<tr>
<td>
<div class="quantity">
<input type="number" step="1" min="0" name="quantity[25]" value="0" title="Qta" class="input-text qty text" size="4" />
</div>
</td>
<td class="label">
<label for="product-25">
<a target="_blank" href="http://localhost:1234/puntoclimatizzatori/prodotto/pompa-di-calore-ctxs15k-daikin-inverter-u-interna-a-parete-5000-btu/">Pompa di calore CTXS15K Daikin inverter U.INTERNA A PARETE 5000 BTU</a>
</label>
</td>
<td class="price">
<del><span class="amount">528,26€</span></del> <ins><span class="amount">290,54€</span></ins>
</td>
</tr>
<tr>
<td>
<div class="quantity">
<input type="number" step="1" min="0" name="quantity[26]" value="0" title="Qta" class="input-text qty text" size="4" />
</div>
</td>
<td class="label">
<label for="product-26">
<a target="_blank" href="http://localhost:1234/puntoclimatizzatori/prodotto/pompa-di-calore-ftxs20k-daikin-inverter-u-interna-a-parete-7000-btu/">Pompa di calore FTXS20K Daikin inverter U.INTERNA A PARETE 7000 BTU</a>
</label>
</td>
<td class="price">
<del><span class="amount">553,88€</span></del> <ins><span class="amount">315,71€</span></ins>
</td>
</tr>
</tbody>
</table>
<p id="total">Total:</p>
JavaScript
$(document).ready(function() {
var subtotals = [];
$('.input-text').change(function() {
updateTotal();
});
});
function getRowSubtotal(rowToTotal) {
var currentQty = $(rowToTotal).find('input').val();
var thisPrice = $(rowToTotal).find('ins').find('span.amount').text();
thisPrice = thisPrice.replace('€', '');
thisPrice = thisPrice.replace(',', '.');
return Number(thisPrice) * currentQty;
}
function updateTotal() {
subtotals = [];
$('.input-text').each(function() {
var thisRow = $(this).parent().parent().parent();
subtotals.push(getRowSubtotal(thisRow));
});
var total = 0;
for (var i = 0; i < subtotals.length; i++) {
total += subtotals[i];
}
$('#total').text('Total: ' + total + '€');
console.log(total);
}