Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra order is created after checkout is complete #4136

Closed
ghost opened this issue Dec 21, 2013 · 4 comments
Closed

Extra order is created after checkout is complete #4136

ghost opened this issue Dec 21, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 21, 2013

Version: 2-0-stable
Observed behavior: An extra new order is created after customers complete checkout process

Repro Steps:

  1. add a product to cart
  2. register new account
  3. walk through the checkout process and complete current order

Possible cause:
Once an order is complete, the session[:order_id] is set to nil. Before OrdersController#Show runs, the before filter set_current_order creates an extra order.

@radar @huoxito Can you take a look?

@huoxito
Copy link
Member

huoxito commented Dec 21, 2013

I think I have noticed it before too but it never really bothered me. I believe all pages or at least most of the pages within frontend will create an order for the user. Guess we only have to avoid creating new orders on the orders_controller/show action.

@ghost
Copy link
Author

ghost commented Dec 21, 2013

I think it's important to only create an order after a user adds a product to cart. Reason is that when you look at the conversion rate or performance of the site, whether an visitor actually created an order is a pretty important metric.

@huoxito
Copy link
Member

huoxito commented Dec 21, 2013

Yeah makes sense. Will take a look

@ghost
Copy link
Author

ghost commented Dec 21, 2013

thx, man

huoxito added a commit to huoxito/spree that referenced this issue Dec 22, 2013
Everytime user was authenticated an order was created by visiting any
page in frontend (if none were already associated with the current user)

Fixes spree#4136

Conflicts:
	frontend/spec/controllers/spree/orders_controller_spec.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant