Google's Simple Shopping Cart [closed]

2019-09-22 09:19发布

问题:

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 ...

回答1:

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 :)