It appears that the bug is due to the fact that while adding the step "Shipping Address" to the checkout (in the file vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js) , the only check to detect whether the form should be displayed by default is done on the quote, whether it is virtual or not (the same condition that tells whether the step should be included at all) . There is nothing to check for existing steps and hide the "Shipping Address" form if a new step is added before it.
You can set the ko.obserable(false) to fix this...
But i am facing a new issue the template file is not called.
I did eventually do this, after having spent a day figuring out how it works. I also added a condition where if the hash string is equal to "shipping", then the default component without any extensions is used.
It's a shame that there's a need for a workaround, shouldn't this be working OOTB?
Is your template called ???
Yes.
Did u try it in Magento version 2.1.5
No, only in 2.1.3 for now.
It's a project I'm doing for work, and I'm not in charge of upgrading Magento on this particular project, so I can't test this with the version,2.1.5 for the time being.
Same problem for me.
Preconditions
I have also referred this isse in devdocs
https://github.com/magento/devdocs/issues/1070
Is there any patch for the issue?
Confirmed it's also an issue with:
Magento version 2.1.6
PHP version 5.6.30
Used browser: Google Chrome, Mozilla Firefox
Also an issue with Magento 2.1.7 however i cannot fix with workaround "ko.obserable(false)" Second step is then shown instead of first.
I tried the sample mixin code in the dev docs (http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_new_step.html) but it didnt work out. turns out the sample code is missing a important line.
add the following line to the Vendor_Module/js/view/shipping-payment-mixin file:
this.isVisible = kko.observable(false)
payment.js uses the isVisible variable to store the value if the step should be visible or not. whereas, shipment.js uses the visible variable to do the same.
The sample code in the dev document is missing the line above which is why two steps are activated on the loading of the checkout.
shipping-payment-mixin.js contents:
define(
[
'ko'
], function (ko) {
'use strict';
var mixin = {
initialize: function () {
// this.isVisible variable is used by Magento_Checkout/js/view/payment. this variable is missing from the sample code.
this.isVisible = ko.observable(false);
// this.visible variable is used by Magento_Checkout/js/view/shipment.
this.visible = ko.observable(false);
this._super();
return this;
}
};
return function (target) {
return target.extend(mixin);
};
}
);
On a side note, remember to change the sort value in the initialize function in my-step-view.js and sortOrder value in checkout_index_index.xml if you want the custom step to be the first step. Hope this helps someone.
https://github.com/magento/magento2/issues/8875#issuecomment-316922684 is it working?
@AlexandreKhayrullin, thank you for your report.
We've created internal ticket(s) MAGETWO-83363 to track progress on the issue.
andrewli-ca Seems to work unless you are only purchasing downloadable products. Then the payment/review sections still shows up.
@andrewli-ca Does this work if only custom step and payment step are involved ?
Hello everyone, I looked into the issue and I'm going to close it for the following reasons:
If you feel there is still some work to be done within this issue then please let me know and reopen it and I'll gladly help anyway I can.
Most helpful comment
I tried the sample mixin code in the dev docs (http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_new_step.html) but it didnt work out. turns out the sample code is missing a important line.
add the following line to the Vendor_Module/js/view/shipping-payment-mixin file:
this.isVisible = kko.observable(false)
payment.js uses the isVisible variable to store the value if the step should be visible or not. whereas, shipment.js uses the visible variable to do the same.
The sample code in the dev document is missing the line above which is why two steps are activated on the loading of the checkout.
shipping-payment-mixin.js contents:
define(
[
'ko'
], function (ko) {
'use strict';
);
On a side note, remember to change the sort value in the initialize function in my-step-view.js and sortOrder value in checkout_index_index.xml if you want the custom step to be the first step. Hope this helps someone.