Currently when the progress is set to make the titles as links the only items which are links are to the left of the current page. It is in fact valid to link to any page which is less than the current order status. If my checkout process has 5 steps and I have made it to step 4, if I click on the link for step 2 then I can't directly get back to step 4, which I should be able to.

Patch to follow.

Members fund testing for the Drupal project. Drupal Association Learn more


applicity_sam’s picture

Status: Active » Needs review
3.8 KB

The attached patch makes the change in behaviour described. I have added a configuration option so that it will not change the behaviour for existing implementations. You will need to check the box in the module configuration in order for the new behaviour to be seen.

andrewbelcher’s picture

Rather than duplicating code, which could lead to similar issues, we switch to using commerce_checkout_page_access() which is specifically for this?

Patch attached.

nvahalik’s picture

Issue tags: +sprint

Tagging related issue already in the queue.

nvahalik’s picture

Two reasons why I'm opposed to this change.

The first is that commerce_checkout_page_access won't allow it either because it disallows access to any checkout page whose weight is greater than it's own:

    // Prevent access to later steps of the checkout process.
    if ($checkout_page['weight'] > $status_checkout_page['weight']) {
      return FALSE;

The second is that being able to navigate to any point visited in the checkout process could cause issues. For instance, let's say I have these steps:

  1. Cart review
  2. Billing info
  3. Gift information
  4. Shipping info
  5. Shipping selection
  6. Payment
  7. Complete

Now, for one reason or another I travel to gift information, which then changes which shipping options are available, the customer won't have a chance to choose their shipping option again because they won't see it let alone know that the options have changed. Keeping track of these changes are also likely complex and probably more trouble than what it's worth.

Maybe rszrama or mglaman might have more to say.

mglaman’s picture

Yeah, I think you shouldn't be able to skip back three pages then resume, order information might become stale, etc. "Here let me hijack my shipping info..." because it's on its own page (by default.) I also don't think I've seen this functionality else where and it'd go against how Commerce Checkout operates.

In my honest opinion this module is a user experience enhancement of the main module, not something to alter how it functions at its core.

nvahalik’s picture

Status: Needs review » Closed (won't fix)
andrewbelcher’s picture

Status: Closed (won't fix) » Active

What about making it an option? Our use case is a booking system that you can come back to multiple times to add tickets/adjust accommodation and make either whole of partial payments (ie deposits/instalments).

Due to those exact issues, we have a number of checks that happen at the final 'payment' stage, so people can't pay a deposit/instalment/balance without passing checks (such as enough accommodation for the tickets added). An option, would allow these 'advanced' processes to work.

nvahalik’s picture

Status: Active » Closed (works as designed)

@andrewbelcher: It sounds like a one-off use. Patches are always welcome. Until those links can be trusted to properly ensure form state, the safest and only supported way to navigate forward in the checkout process is to use the form buttons at the bottom.