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

Order going back to Address state after complete #11930

Open
rahul-bash opened this issue Sep 13, 2023 · 0 comments
Open

Order going back to Address state after complete #11930

rahul-bash opened this issue Sep 13, 2023 · 0 comments

Comments

@rahul-bash
Copy link

In Spree when an order is completed it is suppossed to be in complete state but sometimes, When i create order its state changes to address state automatically and shows the payment state as paid.

Context

The issue of order changing its state to address state after complete occurs when a user try to go back to cart from the payment confirm page(after confirming the payment). then user get into cart and updates cart(like adding items quantity).after that the user tries to proceed the checkout process after modification, user is directed with an empty basket or order already placed message in frontend.
When we open the above order in admin its state shows as address.

Expected Behavior.

The order should not go into address state once it has been completed.

Actual Behavior

Order is going to address state after being completed.

Possible Fix

It seems that restart_checkout_flow method(in core/app/models/spree/order.rb file) is being called after the order is complete, which chnages order state to address.

Steps to Reproduce

  1. Add product to basket on fromtend and proceed till payement confirm page
  2. On payment confirm page click on confirm(button to go to next state ot complete the order) and then while order is processing try to go back to cart before order is completed.
  3. Modify the cart (add or remove quantity) and proceed for checkout.
  4. Order already placed or Empty basket message will appears.
  5. Go to admin and check the state of the above order, it will be in address

Your Environment

we have replicated the issue on dev, production and staging enviorments.

  • Version used: spree 4.3.2, branch:- 4-3-stable
  • Gemfile and Gemfile.lock as text in a Gist:
  • Any relevant stack traces ("Full trace" preferred):
  • Here is the orders state changes in admin:-
    state-changes
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