small medium large xlarge

Altosh_pragsmall
13 Apr 2016, 02:50
Askarbek Karasaev (45 posts)

Book page 126, PDF page 141

There’s a screenshot on top of the page. It’s showing 2 CoffeScript items for the same cart (i.e. for the card with id 1). But in my case, it’s showing only 1 item per cart. So, if I go back and add another item, it creates another cart.

My repo

https://github.com/tenzan/depot/tree/247b6574ec01cc19f604353ce5d58617dd190ec2

Samr_small_pragsmall
15 Apr 2016, 10:20
Sam Ruby (634 posts)

Just a quick comment: I’m on vacation with limited internet access; won’t be returning until Tuesday.

Generic-user-small
14 Oct 2016, 22:07
Chris Detlef (1 post)

I’m having the same issue. Each time I add an item to a cart it creates a new cart.

The counter for how many times the main page has been viewed works right now. However even after setting the @count back to 0 after the ‘Add to Cart’ button is clicked when I go back to the main page the count is not reset. (Start in store count = 1, click on Add to Cart, count displays as 0, then go back to main page and count is now at 2)

Perso2-smaller_pragsmall
16 Oct 2016, 01:36
JS Bournival (5 posts)

Make sure the :cart_id, in the session is set to @cart.id, and not @cart_id.

That was my silly mistake.

Generic-user-small
27 Sep 2017, 06:44
Simon Parrington (1 post)

Hi

I have exactly the same problem.

Pressing add to cart creates a new cart every time.

I have double checked every line.

Any ideas please?

You must be logged in to comment