I'm also getting an Index Error, "list index out of range" for the
"request.session['cart'][1] += 1" line. I can't figure out what's
wrong.
On Feb 9, 3:02 am, lnysrogh wrote:
> Thank you so much. That helped a lot. Such a simple mistake.
>
> I've got some other questions
Thank you so much. That helped a lot. Such a simple mistake.
I've got some other questions now. My "add to cart" code:
def add(request, product_id):
added = (Product.objects.get(id=product_id), 1) # '1' is quantity
request.session.set_test_cookie()
if
lnysrogh wrote:
> Hello. I'm new to Django (and web development in general), and this is
> my first post here. Hope someone can help me.
>
> I'm trying to build a shopping cart, and my idea is to store the
> product information (id and quantity) in a session when I add the
> product to the
Hello. I'm new to Django (and web development in general), and this is
my first post here. Hope someone can help me.
I'm trying to build a shopping cart, and my idea is to store the
product information (id and quantity) in a session when I add the
product to the shopping cart, and retrieve it to
4 matches
Mail list logo