0
Django shopping cart
I want to create a shopping cart for my django app, but I don't know, how to start. I'm thinking about getting the session-id and store it to a database together with the item-id. So I think I have to use a cookie for that(?). Is that the right way to go? I'm also thinking about "django-shop". Any experience with that? Can you recommend a video-tutorial?
5 Respuestas
+ 3
cookies if you want to be able to retrieve content automatically at server side, but you could also handling cart only with web storage (modern/html5 cookies version, without exchange with server), and transmitting data on demand (post/get http requests and/or ajax -- XML http -- requests)
+ 2
Fu Foy
I think that shopping cart handling would be easiest implemented on client side...
anyway, roughly on server side, you should effectively use session id to keep track in database (meaning you are connected to the site -- ie: no anonymous session -- or you must find a way to identify the visitor)
+ 1
Thanks! I will check this out tomorrow. Web storage seems to be, what I'm looking for.
0
Thanks for your answer!
Client side = using cookies? Sorry for the question, but I'm a beginner.
0
Great! Thanks again for your advise. In django I used:
respone.set_cookie(key,value), which saves a cookie for the session.
I'm not sure, wether this is the html web storage, but it solved my problem.