Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The checkout progress block should have an option (off by default) to link to the previous steps (just like a regular breadcrumb would).
The D7 module had this option. Now that the checkout back buttons have become links, this is feasible.
Comment | File | Size | Author |
---|---|---|---|
#44 | interdiff_40-44.txt | 532 bytes | simgui8 |
#44 | 2859834-44.patch | 8.61 KB | simgui8 |
| |||
#40 | interdiff_35-40.txt | 1.29 KB | simgui8 |
#40 | 2859834-40.patch | 8.57 KB | simgui8 |
| |||
#35 | 2859834-35.patch | 8.5 KB | andypost |
Comments
Comment #2
Wim LeersWhy optional? Why not enabled by default? This is a huge usability win.
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedIt was off by default in the D7 module, and my previous checkout research (looking at major sites) didn't show it to be common.
I'd be happy to re-investigate and flip that boolean, once we have the actual code for it :)
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedComment #5
finneComment #6
finnePR: https://github.com/drupalcommerce/commerce/pull/686
Comment #7
Lukas von BlarerThe pull request doesn't apply anymore.
Comment #8
mglamanI'd like to postpone this until #2869818: Checkout progress block does not set current step appropriately when 'go back' link is used is merged. This provides a utility method for testing the currently highlighted step, and adds test coverage to the fact they even work.
Comment #9
mglaman#2869818: Checkout progress block does not set current step appropriately when 'go back' link is used landed. This should be quick to implement and test.
Comment #10
Lukas von BlarerDoes this only need a reroll or do we need to implement it diffrently?
Comment #11
mglamanIt needs a re-roll and tests. The issue I referenced in #9 provides test coverage for the block, which we were missing. So it'll be easier to work on this, now.
Comment #12
Lukas von Blarerok, i'll give it a try tomorrow.
Comment #13
Lukas von BlarerI re-rolled the pull request here and improved/fixed the tests:
https://github.com/drupalcommerce/commerce/pull/732
Comment #14
Lukas von BlarerRe-rolling.
Comment #16
flocondetoilePatch #14 rerolled for commerce 2.5
Comment #18
flocondetoileComment #20
flocondetoileComment #21
mglamanComment #22
Getekid CreditAttribution: Getekid at BACKBONE commentedHello, I can confirm the patch is working as expected.
Would it make sense to expose the link to the
steps
array? This way one could use it in a custom template e.g. to assign classes to the link tag.Thanks a lot for your work
Comment #23
heddnComment #24
heddnComment #25
flocondetoilePatch rerolled for commerce 2.14
Comment #27
flocondetoilePatch rerolled and updated with new behavior address book
Comment #28
jnrfred CreditAttribution: jnrfred at Acro Commerce commentedPatch tested and works
Comment #29
flocondetoileComment #30
michiellucas CreditAttribution: michiellucas commentedI created this block for my project but used a different approach.
You are checking on if ($index <= $current_step_index) { but you can use the same logic as CheckoutController::formPage
Comment #31
Sumi CreditAttribution: Sumi at Centarro commentedTested the patch and checkbox for enabling this functionality doesn’t do anything. Checkbox is unchecked by default but steps in the progress block are links. No matter if the checkbox is checked or not steps are links.
Comment #32
Sumi CreditAttribution: Sumi at Centarro commentedComment #33
andypostRe-roll for fresh codebase
Comment #34
andypostThere's no link in markup, means test needs more work
Comment #35
andypostFix re-roll for tests
Comment #36
mglamanComment #37
Sumi CreditAttribution: Sumi at Centarro commentedStill checkbox "Display checkout progress breadcrumb as links" is not doing anything. It is unchecked by default but steps are links, it doesn't matter what is set on that checkbox.
Comment #38
mglamanThis doesn't respect
display_checkout_progress_breadcrumb_links
Why did this have to be changed to raw?
Comment #39
simgui8 CreditAttribution: simgui8 as a volunteer and commented# 35 works for me, but the checkbox ain't
Comment #40
simgui8 CreditAttribution: simgui8 as a volunteer and commentedHere is a rerolled patch,
+
The raw filter has been removed
and I have added a display_checkout_progress_breadcrumb_links configuration verification.
Hope it address 1. and 2.
Comment #41
simgui8 CreditAttribution: simgui8 as a volunteer and commentedComment #42
Sumi CreditAttribution: Sumi at Centarro commentedTested the patch and links are now respecting the backend configuration and are working as expected. There is only one thing and that is once user finishes the checkout and is on "Complete" step, previous steps are links but at that point you can't actually go back to "Review" or "Order information" steps so when you click on the links your page just reloads. It would probably be better that once you are on "Complete" step other steps are no longer links
Comment #43
mglamanPer #42, this needs work.
This should check if the current step is the last step as well.
Comment #44
simgui8 CreditAttribution: simgui8 as a volunteer and commentedThis one check if current step is 'complete'
Comment #45
simgui8 CreditAttribution: simgui8 as a volunteer and commentedComment #46
Sumi CreditAttribution: Sumi at Centarro commentedTested the patch and all works as expected.
Comment #47
mglaman💪Thanks!
Per #46 this is +1, will commit later today.
Comment #49
mglamanCommitted 🥳! Thanks all.