产品相同时如何仅更新数量

时间:2019-07-10 09:36:14

标签: jquery ajax

[enter image description here][1]
please check image 
when i add same product i want update only quantity 

enter image description here     1https://i.stack.imgur.com/B3cVe.png

enter image description here enter image description here 请检查我的代码:

   function addRow(product) {
    var qty = $('#qty').val();
    var code_chk = $(".code_chk").text();
    if ($('#procode_1').val() == code_chk) {

        var add_qty = $('#add_qty').text();
        v = ++add_qty;
        $('.set_qty').val(v);
    } else {

        sr++;
        $('#productlist').show();
        var $tableB = $('#productlist tbody');
        var $row = $(
            "<tr>" +
            "<td style='display: none;'>" + sr + "</td>" +
            "<td class='code_chk'>" + product.procode + "</td>" +
            "<td>" + product.prname + "</td>" +
    }
}

0 个答案:

没有答案