Proceed to Checkout redirecting to last step
goranhorvathr opened this issue · 10 comments
Hello! It is a pleasure! I have a small question. Is there any reason why proceed to checkout redirect to the payment step even if there is no address and no default shipping method set. Shouldn't the customer be redirected to the shipping step first?
I tracked the code to
target.steps.sort(this.sortItems).forEach(function (element) { if (element.code == hashString || element.alias == hashString) { //eslint-disable-line eqeqeq element.navigate(element); } else { element.isVisible(false); } });
Visible element which is shipping step is set to false and hashString is equivalent to payment all the time. This looks like a bug to me please confirm. Can we just correct this by checking the current visible step and actually navigate to it instead of payment like this
target.steps.sort(this.sortItems).forEach(function (element) { if (element.isVisible()) { //eslint-disable-line eqeqeq window.location = window.checkoutConfig.checkoutUrl + '#' + code; element.navigate(element); } else { element.isVisible(false); } });
After this correction its then working properly. When customer is not logged in he is directed to email step when he is logged in he is redirected to the shipping step first and can add the address or choose shipping methods or another address and then proceed to the payment step.
We experience this issue with logged in customers. The are directed to the payment step and placing an order gives an error on the shipping address. This change fixes that issue.
Had the same issue, this fix solved it. Would be good to include the fix in the core i believe.
I am having the same issue, can someone help me with file
thanks, I was searching in core module
confirming I have the same issue as this, and the patch
https://github.com/rikwillems/CleanCheckout/commits/1.7.1-patch1 works correctly
Patch introduces new issue, login results in being stuck on email step with all other steps invalidated.
check solution from danslo/CleanCheckoutTheme#3
this resolves my issue.
Worked for me by the change in @goranhorvathr 's code.
window.location = window.checkoutConfig.checkoutUrl + '#' + element.code;
Hi all,
From what I understand of this this is all now resolved (both the original bug in this commit, and the introduced bug in this commit).
If this is incorrect please re-open the ticket (although at this point for clarity it would be better to open a new issue) with a M2 ver and replication steps