开源客户端购物车 - jQuery/Cookies
我希望实现一些看似具有“购物车”功能的东西,但完全在客户端。我可以使用 jQuery 和 cookies 来做到这一点(我发现 这个 Smart Cart 2 插件 可以帮助它的很大一部分),但在我构建它之前 - 有谁知道完全是客户端的现有解决方案,并使用 javascript (最好是 jQuery)和 cookies?
另外,除了一小部分用户的浏览器不支持 javascript 和/或 cookie 之外,还有人认为这种方法存在重大问题吗?
I am looking to implement something that appears to have "shopping cart" functionality, but is completely on the client-side. I can do this using jQuery and cookies (and I event found this Smart Cart 2 plugin for helping with a large part of it), but before I build it - Does anyone know of an existing solution that is completely client-side, and uses javascript (preferrably jQuery) and cookies?
Also, other than the small percentage of users whose browsers don't support javascript and/or cookies, does anyone see a major problem with this approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
simpleCart(js) 非常适合轻量级客户端购物车。显然,手动填写订单以确保为每个订单存入正确的资金。
simpleCart(js) works quite nicely for light-weight, client-side shopping carts. Obviously manually fill orders to make sure correct funds are deposited for each order.
我看到了这方面的安全问题。将某些内容完全放在客户端,然后将其存储在 cookie 中基本上意味着您将流程的完全控制权交给了用户。他们可以编辑交易的每个部分。他们可以映射你的 jquery ajax 调用等,并编辑它们,甚至不按顺序播放它们。
例如,
而不是 1) 将商品放入购物车 2) 小计 3) 收费 4) 结帐
他们可以拨打 1) 小计 2) 收费 3) 购物车中的商品 4) 结帐。
无论如何,无论您实现什么,我都可能会仔细查看所实现的安全功能。
I see security issues with this. Putting something completely on the client-side and then storing it in cookies basically means you are giving complete control of the process to the user. They can edit every single part of the transaction. They can map your jquery ajax calls, etc, and edit them, or even play them out of order.
For example,
instead of 1) put item in cart 2) subtotal 3)charge 4)checkout
they could call 1) subtotal 2) charge 3) item in cart 4) checkout.
In any event, anything you implement I'd probably take a good look at to see the security features implemented.