Created
April 13, 2018 18:28
-
-
Save khanof89/56bd0239dedb512f4462adac8d2e44e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.quantity-plus').click(function () { | |
var total = parseFloat($('.total').html()).toFixed(2); | |
console.log('total ' + total); | |
var info = $(this).data('info'); | |
var id = info.item_id; | |
var price = info.price; | |
var quantity = $('#quantity-' + id).val(); | |
quantity = parseInt(quantity) + 1; | |
total += price; | |
var currentTotal = parseFloat(quantity * price).toFixed(2); | |
console.log(currentTotal); | |
$('#amount-' + id).html(currentTotal); | |
$('.total').html(total); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment