Untitled
unknown
plain_text
3 years ago
776 B
14
Indexable
row = $('*[data-id='+sku+']');
quantity = Number(row.find('.quantity-label').html() || 0) + 1;
if (row.length == 0) {
new_row = "<tr class='nested-fields'><td class='item-selection'>"+data['sku']+"<input value="+data['id']+" type='hidden' name='sales_header[sales_details_attributes]["+sku+"][item_variant_pricelist_id]'></td></tr>";
$('.sales_item_body').append(new_row);
} else {
row.find('.quantity-label').html(quantity);
row.find('.quantity-field').val(quantity);
}
var sum = 0;
$(".item-selection").each(function() {
console.log($(this).val())
sum += 1
});
console.log(sum)Editor is loading...