drhenner / ror_ecommerce

Ruby on Rails Ecommerce platform, perfect for your small business solution.
www.ror-e.com
MIT License
1.21k stars 409 forks source link

Checkout not working #82

Closed TopperH closed 11 years ago

TopperH commented 11 years ago

In a stock install, created and example product, logged out as admin. Logged in as buyer, added a product to the cart, pressed checkout button:

Started PUT "/shopping/cart_items/1" for 127.0.0.1 at 2013-02-05 11:19:57 +0100
Processing by Shopping::CartItemsController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"VNQ3tV2aEG0OKum1PDF1oCaQxGtkfsayxZNT4iJE8V8=", "commit"=>"checkout", "cart"$
>{"shopping_cart_items_attributes"=>{"0"=>{"quantity"=>"1", "id"=>"3"}}}, "id"=>"1"}
  Cart Load (0.3ms)  SELECT "carts".* FROM "carts" WHERE "carts"."id" = 1 LIMIT 1
  CartItem Load (0.3ms)  SELECT "cart_items".* FROM "cart_items" WHERE "cart_items"."cart_id" IN (1) AND (cart_items.active = $
t' AND
 cart_items.item_type_id = 1)
   (0.1ms)  begin transaction
   (0.1ms)  commit transaction
Redirected to http://0.0.0.0:3000/shopping/orders/checkout/checkout
Completed 302 Found in 10ms (ActiveRecord: 0.7ms)

Started GET "/shopping/orders/checkout/checkout" for 127.0.0.1 at 2013-02-05 11:19:57 +0100
Processing by Shopping::OrdersController#checkout as HTML
  Parameters: {"id"=>"checkout"}
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
  Order Load (0.1ms)  SELECT "orders".* FROM "orders" WHERE "orders"."user_id" = 2 AND "orders"."id" = ? LIMIT 1  [["id", 9]]
Completed 404 Not Found in 8ms

ActiveRecord::RecordNotFound (Couldn't find Order with id=9 [WHERE "orders"."user_id" = 2]):
  app/controllers/shopping/base_controller.rb:54:in `find_or_create_order'
  app/controllers/shopping/orders_controller.rb:29:in `checkout'
TopperH commented 11 years ago

Seem to work after pulling the latest source. I probably updated my install in the middle of something.

drhenner commented 11 years ago

This might actually be an intermittent thing with the cart not updating the user_id at the right time. I'll keep a look out. If it happens again open this up again.