ongr-io / demo.ongr.io

Demo application of ONGR.
http://ongr.io
MIT License
29 stars 24 forks source link

add read only shopping cart #156

Open ThomasLohner opened 8 years ago

ThomasLohner commented 8 years ago

Same principle as with the Importer: We got rid of all specific importers and implemented one generic Import via API.

Now we need to get rid of all specific implementations of shopping carts and add one solution to the frontend: Read data from Cookie and show on page.

How this data gets into the cookie should not be our concern at this moment.

saimaz commented 8 years ago

I thought about the implementation of this feature. There're 2 ways of using it.

  1. Use cookie directly. Well, a cookie is already as a standalone service like. And you can use it via JS directly. As of usage with JS, we cannot create any library because we don't know what user will use, Angular 1.0, 2.0, React, Ember or some other new stuff. So the only thing we can advise here is a cookie structure.
  2. Provide cart API endpoint and objective service. We could provide an API endpoint to update a cart info. With this solution, we could decide what we want to use for the storage, cookie, session, Memcached, Redis etc. In project via JS project could request info from the endpoint or in PHP from a service. Win win situation. The problem is, at the checkout part, it has to be updated with an HTTP call.

This is just a thoughts. @ThomasLohner, we need your feedback on this.