Here is the simple shopping cart I was looking for: http://code.google.com/p/jscart/wiki/Example. Thank you everyone for your help. All the notes led me to rethink and ponder ... hmm, I wonder if someone out there has already done something similar ...
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
It's because of your "currentStateOpened". If you addd your first Item it will be set to false and thus the second item will have as total price "0".
However, you probably should code the whole thing differently. I hope that is for training purposes to get started with JS and you don't plan on using that in real life :)