Skip to main content

HOW TO INCREASE AND DECREASE TOTAL PRICE BY PRODUCT QUANTITY - SHOPPING CART - NODE JS, EXPRESS JS

<html>
<td data-th="Quantity" class='addtocart1' >
     <input type="hidden" id="pricecounter" value="<%- cDetails[i].price %>" >                            
<b> <input type="number" id="qty"  class="form-control text-center" min="0" max="10" value="1"> </b>  
</td>  

<script>


$(document).ready(function(){
        //============= Product Quantity Start ===========
        var priceCount = $('#pricecounter').val();
        //var qty = $('#qty').val();
        var counts = 0;
        $(".addtocart1").change(function () {
            var qty = $('#qty').val();
                                             
            $(".cart-counter1").animate({
                 opacity: 1
                    }, 300, function () {
       
                        $(this).text(priceCount*qty);
                    });
                });
            //============= Product Quantity End ===========
           
           
       
        });


</script>

</html>

Comments