-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Separate the checkout flow states from the order states #142
Comments
In this episode of Solidus Issue Background History: Historically Spree::Order.state was a state machine very tightly integrated to the "checkout steps" a user would go through in order to complete a checkout. A "cart" would enter the "checkout" state when the checkout button was made. An order progresses through these states with the magic ".next" method, which just pushes an order through the states if it meets the criteria of being able to move forward. As checkout's became more customized (single page API driven, re-ordered flow, etc) and the number of "states" we considered an order in increased (fraud, cancelled) it became clear that state_machine model we have is overly complex and tied to an outdated _frontent checkout flow. The core team has identified that the checkout flow should not be dictated by an Order's state machine and should be pulled out and supported in a different way, which we hypothesize should improve comprehension and reduce complexity of an order. Extracting the address/delivery/payment/checkout state from the Spree::Order should be considered a very advanced topic, likely only accomplish-able by someone with a very thorough understanding of the spree order state machine. |
Dibs. (On cracking the order state machine code.) |
Keen to follow along / help out here where possible - at least from a "chatting things out" perpective. The Spree Ember Checkouts package is a promise aware state machine that wraps the current order. Keen to do what I can to support the new approach! |
Hawth and I are going to kill this, as while we would love to see it done, it's not actionable with how the codebase is now. We have many more tasks we need to accomplish first before this can be tackled reasonably. |
Recalculate payment total when order total decreases
The order state machine is heavily tied to the solidus_frontend checkout states. It would be nice to remove that tie, and allow the order to be handled without those specific states, or maybe without the state_machine gem at all.
The text was updated successfully, but these errors were encountered: