Closed omkar-tenkale closed 4 years ago
Hey omkar-tenkale,
If you include the lib directly (via cdn) you need to use the cartLS instance. Here is a working example:
document.addEventListener("DOMContentLoaded", function(){
const myproduct = {id: 3, name: "Vans", price: 75}
cartLS.add(myproduct, 2);
console.log(cartLS.total())
})
Also please use the latest version (1.1.4):
<script src="https://unpkg.com/cart-localstorage@1.1.4/dist/cart-localstorage.min.js" type="text/javascript"></script>
When using
ReferenceError: _typeof is not definedcart-localstorage.min.js:1:12