Magento2: Shipping address information is lost in billing step

Created on 2 Apr 2019  路  19Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3.1 (or Magento 2.2.8)
  2. PHP 7.2 (or PHP 7.0)
  3. Samples data

Steps to reproduce (*)

  1. Connected with the sample account ([email protected] / [email protected])
  2. Add a product to cart
  3. Go to checkout
  4. Validate shipping address
  5. Uncheck "My billing and shipping address are the same" and choose "New address"
  6. Fill the address form (especially postal code) and clic on "Update"

Expected result (*)

  1. "Ship to" information is not modified
  2. If back to shipping step, my previously shipping address is selected

Actual result (*)

  1. "Ship to" information is updated with empty values
    image
  2. If I return to the shipping step, my shipping address is no longer selected
    image
  3. With magento 2.2.8, it is possible to validate shipping step without address
Checkout Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

All 19 comments

Hi @delyriand. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@delyriand do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

@magento-engcom-team give me 2.3-develop instance

Hi @delyriand. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @delyriand, here is your Magento instance.
Admin access: https://i-22112-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

I confirm that I reproduce the problem on 2.3-develop branch

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [x] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [x] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [x] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [x] 6. Add label Issue: Confirmed once verification is complete.

  • [x] 7. Make sure that automatic system confirms that report has been added to the backlog.

:white_check_mark: Confirmed by @engcom-backlog-nazar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99015, MAGETWO-99016 were created

Issue Available: @engcom-backlog-nazar, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Hi @maheshWebkul721. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

Hi @shikhamis11. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.


I traced my appearance of this issue, on 2.2.8, to the file vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rates-validator.js line 200.
Commenting this line fixes the issue and doesn't seem to have any other negative effect.

I notice that when being logged in and having an empty local storage the issue appears. After reloading the checkout the selected address remains selected. Also when not being clicked/selected at the first load. Clearing the local storage and reloading the checkout makes the issue appear again. The selected address becomes unselected after a second or so.

In the network tab two calls are visible when the issue occurs:
rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id
rest/default/V1/carts/mine/estimate-shipping-methods

I can confirm that that the same issue appears on 2.3.1 Commerce. It can be reproduced with steps delyriand described.

In my case there's also a popup with an error:
Carrier with such method not found: %1, %2

and 404 error from /V1/carts/mine/shipping-information where the billing_address is filled up correctly and the shipping_address has empty values.

I'm facing this same issue and am trying to find an elegant solution. Tracing the code altered in this PR up to where it is initiated I find vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rates-validator.js lines 150-152 being of interest.

self.validateAddressTimeout = setTimeout(function () {
    self.validateFields();
}, delay);

It seems strange to me that the fields are validated on a timeout rather than on billing address change. Is that strictly necessary? Additionally, validateFields() calls selectShippingAddress(address) (vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rates-validator.js line 198) without checking if the billing and shipping addresses are set to match; why should the shipping address change when the billing address is validated if they aren't even supposed to match? My thought would be to change the code such that validateFields is only called when the billing address is updated and only call selectShippingAddress if the billing address and shipping address are supposed to match. Is there someone more knowledgeable in this section of the code who can tell me if such a solution makes sense?

Tagging @sidolov as he was involved in a closed PR to address this issue and may have valuable input.

Hi @sjb9774 , we found an issue with the solution and PR was closed due to inactivity. You may create your own PR with proper solution and we will process it. Thank you!

Hi @rikwillems,
This is function to refresh shipping method.
When you comment it, the website will can't get shipping method when change Postcode.
Thank you!

Hi @delyriand, @rsimmons07.

Thank you for your report and collaboration!

The issue was fixed by Magento team.

The fix will be available with the upcoming 2.3.3 release.

Hi @magento, @delyriand, @rsimmons07.

We have installed the new release: Magento 2.3.3
but we are still getting the same error:
"The shipping address is missing. Set the address and try again."

Can you confirm this is fixed?

image

I have this issue on my 2.2.6 installation. Can you confirm the fix is available for 2.2?

I faced the same issue.

1.rest/default/V1/carts/mine/estimate-shipping-methods 500 Internal Server Error
2.rest/default/V1/carts/guest/estimate-shipping-methods 500 Internal Server Error

At checkout page shipping methods were not displaying. This is issue with Magento_Amqp ,Magento_MysqlMq and Temando_Shipping modules.

I solved this issue by updating composer. First run composer update command.

Run the command below and re-deploy magento.

composer update

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Was this page helpful?
0 / 5 - 0 ratings