sample-pie-shop
sample-pie-shop copied to clipboard
Implement client-side Add to Cart
At the moment we use a form submit for Add to Cart.
This works fine (and demonstrates a SSR solution, as intended) but results in a server request and a page reload each time an item is added to the cart.
We'll need to do something different once we've implemented identity/login but, in the meantime, we could look at simple JavaScript options, to update a local cart stored with localStorage (or whatever). It might be nice to combine this with a server-side rendered cart page. (We've also talked about looking into offline/flakey options at a later date: site functionality — including Add to Cart — should be available.)
I've made a start on a Cart class — give me a shout if you're picking up this PR.