Tell me it is not how it looks like, simpleCart (screenr.com)

5 points by samzhao ↗ HN
I just found a crazy little bug in the Javascript shopping cart plugin, simpleCart.js. I am a javascript noob. I do a lot of jQuery code writing and debugging at this stage, and I use Google Chrome. I found that if you change the price tag of any item using Chrome's "Inspect Element", you can purchase that item at any price you change it into. I don't know if there's something wrong with the demo shop, or the plugin itself is broken. Can some pros tell me if there's really something wrong?

6 comments

[ 4.2 ms ] story [ 26.9 ms ] thread
Last time I checked this actually worked in production as well, as the values are changed before the form is submitted and no data is pulled from a server to validate. So SimpleCart should be used for low traffic websites, where orders are manually inspected, as they said on their github page https://github.com/wojodesign/simplecart-js/issues/150
Manually inspecting the price of each purchase, as an alternative to doing a server-side check? That would be the equivalent of being able to change the price associated with a product barcode and asking cashiers to verify the prices for everyone's purchases.
Ha, I know. I wasn't stating my own opinion there though. Adding in a server-side check seems to be the only way to solve this (Note: My knowledge on this subject is limited), but doing so removes the advantage they have, which is the easy implementation. This would be cool if it worked flawlessly, but then again, it doesn't (yet).
Sigh.. I guess we have a winner between javascript and php now. (I heard a lot of debates recently arguing the javascript would replace php)
Javascript is not really the issue here, some things just shouldn't be done on the client side.
Is getting information from JSON going to solve the problem at all? I like the simplicity of simpleCart, and I do a lot of front-end stuff. With simpleCart, I don't have to write a huge chunk of server side scripts and correspond the back-end with the front-end. I can just add a few classes in my html and simpleCart is going to do the magic.