peet86 / cart-localstorage

JavaScript Shopping Cart library on top of localStorage
https://peet86.github.io/cart-localstorage/
MIT License
91 stars 18 forks source link

quantity update not working #9

Closed Brecht272727 closed 3 years ago

Brecht272727 commented 3 years ago

If i use the cartLS.quantity(id,1); or cartLS.quantity(id,-1); the quantity is going p.e. from 7 by default to 71 instead of 8 What is going wrong?

mcanguler commented 3 years ago

If i use the cartLS.quantity(id,1); or cartLS.quantity(id,-1); the quantity is going p.e. from 7 by default to 71 instead of 8 What is going wrong?

this code is working

var $input = $('#quantityInpt' + data.id).val(); $input = parseInt($input); cartLS.add({id: data.id, name: data.name, price: data.price}, $input);