Google的简单购物车 [英] Google's Simple Shopping Cart

查看:167
本文介绍了Google的简单购物车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我一直在寻找的简单购物车: http://code.google的.com / p / jscart /维基/实施例。感谢大家的帮助。所有的笔记让我重新思考和思考......嗯,我想知道有人在那里做过类似的事情吗? 解决方案

这是因为你的currentStateOpened。
如果您添加了第一个物品,它将被设置为false,因此第二个物品的总价将为0。

然而,您可能应该以不同方式编码整个事物。我希望这是为了开始使用JS的培训目的,并且你不打算在现实生活中使用它:)


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

解决方案

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

这篇关于Google的简单购物车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆