Josh (the blog)

Hey there. I’m Josh, a SydneyCanberra-based maker of Internets. I don’t update this very often.


@joahua

The Need for AJAX shopping carts

I always thought the script.aculo.us drag’n’drop-shop demo was stupid. It seemed illogical and only really practical for stupid puncy little shops with five or ten products – certainly, with everything listed on the same page.

Then it hit me — this is perfect for shuffling documents around. CYIADA (see-uh-da), is (partially) about selling documents and resources electronically — and it does that with pre-paid credits. This, of course, means that there doesn’t have to be any cumbersome checkout stage. Better than Shopify (excellent though that is), potentially.

Drag documents you like when browsing into a floating “My Resources” bin on the side of the page, AJAX is used to throw up a “confirm purchase” DIV which presents simple “yes”/”oops” options, and keep moving. It’d be trivial to modify the confirm view to have a “purchase for my whole group” checkbox (which would, of course, change the cost), too. Anything beyond that might be too complex.

Of course, there would be graceful degradation for those without JavaScript turned on… because someone has to ruin the party :P