Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Checkout
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Jun 2016 at 16:32 UTC
Updated:
10 Jan 2017 at 14:54 UTC
Jump to comment: Most recent

Comments
Comment #2
mglamanThe resolution here is: The "back" button needs to actually be a link, and after the primary button to continue.
Comment #3
rszrama commentedAs another option, we could use the formnovalidate attribute on "Cancel" and "Back" submit buttons:
http://www.w3schools.com/tags/att_input_formnovalidate.asp
This is likely more important for "Cancel" than "Back", but I can imagine scenarios where sites may want to alter behaviors onto even the submission of a Back button in checkout.
Comment #4
bojanz commentedThe primary reason for the #2 decision was checkout UX, saw the button styled as a link on most nice checkouts, including Shopify.
Today I caught more bugs due to this being a button. Payment methods were being created on "back", and Braintree was even submitting the wrong button (going back instead of forward). I could have added individual fixes for both issues, but by doing this issue we fix all of them at once. Plus, we save a bit on performance, cause we no longer resave the order when going back.
That means that Ryan's use case in #3 stays unsolved for now, but we can address that at a later date with a checkout router event.
PR up at https://github.com/drupalcommerce/commerce/pull/590, waiting on tests.
Comment #5
mglamanThis causes issues with the current checkout access. We are expecting the checkout flow to have adjusted the saved order step on submission of the form.
Unless we modified that work to allow going backwards one step manually?
Edit: unless there was a specific back route which did this and allowed any processing, like firing an event
Comment #6
bojanz commentedWhy would it? Checkout access always allows steps previous to the current one.
The way I see it, leaving the checkout step as is makes sense. Let's say I'm on the review page, then I decide to go back to order information and take a peek at my info, but if I don't save anything, my last checkpoint is still the review page.
Comment #8
bojanz commentedThe build passed, committed.
A nice thing about this change is that it allows people to make the checkout progress steps clickable, there's now no difference between the two ways of going back. And the checkout flow and the checkout router can still perform any needed logic when the previous step is reached.