small medium large xlarge

22 Feb 2010, 22:41
Matt Cannon (7 posts)

im using rails 2.3.5 and it will only allow me to add one item to the cart; every time I click add to basket, it deletes the old item and adds the new one in its place.

any ideas on what could be causing this?

23 Feb 2010, 00:36
Sam Ruby (633 posts)

Check the following page to make sure you are following the instructions needed for Rails 2.3.5:

If that is not the problem, one possible cause for this is that you are getting a new cart each time. Check app/controllers/store_controller.rb for the following line:

session[:cart] ||=

Check app/controllers/store_controller.rb for the following line:

@cart = find_cart

Also check that your haven’t disabled cookies in your browser.

23 Feb 2010, 06:34
John G Wesp (1 post)

I ran into the same issue on OS X 10.6 using Firefox 3.5.8. What fixed it for me was the deletion of all cookies (the ‘localhost’ cookie would have probably been enough).

Safari doesn’t have this issue and the cart retains its items.

What I don’t understand though is this, aren’t we using the database, via ActiveRecord, to store the cart data? In my ‘sessions’ table i see 2 rows, corresponding to the Firefox and safari sessions, which is what I expected.

25 Feb 2010, 00:24
Matt Cannon (7 posts)

Thanks for the help, i had missed an = sign, sorry i took so long to respond, half way through checking mysql died a death.

You must be logged in to comment