While testing the checkout flow we discovered an issue when continuing from the shipping step to the payment step. This is what we observed, though only occasionally:
#shipping-method-buttons-container .button).We are currently on beta8 and have reproduced this both on Luma as well as our custom theme.
My team narrowed it down to being an issue with timing of the estimate-shipping-methods ajax call. estimate-shipping-methods only requires country and postcode and saves the address with only these values. In cases where the bug appeared, this estimate-shipping-methods occurs _after_ the shipping-information, saving the truncated address (bad).
Further digging into when shipping-information is called. In this file a 2s delay is set between calling validation for the shipping address form:
app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js
The bug generally occurs when you proceed through checkout very quickly (form autocompletion helps with this) and you click the continue button within this 2s window, before the shipping-information ajax call is fired.
We have not been able to fully resolve this issue, but we have reduced the likelihood of it occurring by reducing the delay from 2000 to 500.
@chicgeek
Please, provide the used version. If the problem is actual for a specific tag, please, specify it and be sure that the latest update was used.
@palamar Beta8, as specified in my original post.
We've upgraded our project many times since I posted this bug five months ago. We patched this locally as it was hindering development and I am no longer in a position to test if it is still an issue.
@chicgeek What was your fix? We are facing the same issue. Sometimes its quite frequent and we are facing it in a row for 8-9 orders and sometimes it just works fine.
@skmomemo As per my first post, we reduced the delay from 2000 to 500. I believe we created a patch for this work.
@palamar This bug is still present in the latest release. Do you still need an update on this?
Morning @palamar Initially this was a problem on Beta8 But we are not on Magento 2.0.7 and experiencing the same issue. Looking at the file @chicgeek posted as containing the issue https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js#L37 the bug is still present in newer versions.
Do you know if there is an internal Magento ticket reference created for this ?
@chicgeek
Thank you for reporting this issue and solution!
For now, we do not have an internal ticket for this issue.
We will provide ticket number after it will be created.
@chicgeek @skmomemo @jamescowie thank you for reporting the issue!
For 2.1.x branch our internal ticket is MAGETWO-59024.
I have the same problem and " reduced the delay from 2000 to 500" is not working for me.What solution is solving this issue ..
Additionally to suggestions here and elsewhere, I also needed to add the attributes to the customer_form_attribute table to bring my fields back after an M1=>M2 data migration. E.g:
INSERT INTO customer_form_attribute (form_code, attribute_id) values ('customer_register_address', 34);
INSERT INTO customer_form_attribute (form_code, attribute_id) values ('adminhtml_customer_address', 34);
INSERT INTO customer_form_attribute (form_code, attribute_id) values ('customer_address_edit', 34);