sample-pie-shop icon indicating copy to clipboard operation
sample-pie-shop copied to clipboard

Implement client-side Add to Cart

Open samdutton opened this issue 7 years ago • 0 comments

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.

samdutton avatar Jun 22 '18 15:06 samdutton