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.
Problem
On the page mysite/cart I don't see a "Payment" stage but on the page mysite/checkout/ - I do.
It should be visible but it is not - that is the problem.
I have a solution already and will provide a patch soon.
Comments
Comment #1
PatchRanger CreditAttribution: PatchRanger commentedRecipe
The root of the problem is in the way an order is loaded : it works perfectly for checkout page and does not - on cart page.
All we need is a way to get an order on cart page.
Solution
It was not so hard : just use convenient commerce_cart function to load an order by user id.
I have also added a checking of existence commerce_cart module.
If it is not enabled, then the page mysite/cart does not exist - and so does a bug.
Patch works fine for me.
Please review.
Hint : you could easily apply a patch by using Patch Manager module.
Comment #2
PatchRanger CreditAttribution: PatchRanger commentedHmm, further investigation discovered that $order->data array is empty on cart and checkout pages. It is important because this array is used to get payment method instance and then decide whether we should display this stage or not. The only place where it is set is payment page.
Comment #3
PatchRanger CreditAttribution: PatchRanger commentedOk, I figured it out.
Solution
Just delete special case about handling off-site redirection. The reason is that off-site redirect does not redirect directly, we should submit payment form before redirect (see screenshot attached). That is why we should display it in "stage breadcrumb".
Please review the patch attached.
Comment #4
PatchRanger CreditAttribution: PatchRanger commentedSmall improvement.
Comment #5
bendev CreditAttribution: bendev commentedpatch works great , thanks !
Will it be included in the next version ?
Comment #6
PatchRanger CreditAttribution: PatchRanger commented@bendev Glad to hear.
We need at least one more reviewer to put this issue in "reviewed & tested by the community" status.
Then one of module maintainers will take a look on it and commit it to dev version.
When it will become a part of stable version I really don't know - you should ask a maintainer.
Comment #7
jcisio CreditAttribution: jcisio commentedI think we need to:
- Look at the commit that introduce this "special case" code to see why it was added
- Or, have a few more reviewers/testers.
Of course, when it is committed, it will be included in the next version.
Comment #8
PatchRanger CreditAttribution: PatchRanger commentedHere you are :
The issue there is about displaying stage if page is empty.
But as I mentioned in #3
So the problem here is that it is definitely unclear what is the issue in #1293866: Need to remove empty pages from progress bar.
I can not reproduce that issue and this one is fixed by the patch.
Comment #9
jcisio CreditAttribution: jcisio commentedThanks for the great explanation! I've just committed 6039931.