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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PatchRanger’s picture

Status: Active » Needs review
FileSize
1.07 KB

Recipe
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.

PatchRanger’s picture

Hmm, 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.

PatchRanger’s picture

Ok, 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.

PatchRanger’s picture

bendev’s picture

patch works great , thanks !
Will it be included in the next version ?

PatchRanger’s picture

@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.

jcisio’s picture

I 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.

PatchRanger’s picture

Look at the commit that introduce this "special case" code to see why it was added

Here you are :

The issue there is about displaying stage if page is empty.
But as I mentioned in #3

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".

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.

jcisio’s picture

Status: Needs review » Fixed

Thanks for the great explanation! I've just committed 6039931.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.