magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.58k stars 9.32k forks source link

Magento holding on to new shipping address even when selecting existing #37343

Open ksenia-zlotin opened 1 year ago

ksenia-zlotin commented 1 year ago

Preconditions and environment

Magento 2.4.4

Steps to reproduce

  1. Add simple product to cart as a logged in customer with a default address
  2. Proceed to checkout, on shipping step add a new shipping address in that step
  3. Proceed to billing step to calculate taxes and save it
  4. Go back to shipping step and select an existing address
  5. Proceed to billing step to calculate taxes and save the shipping address selected in the quote
  6. Visit the cart page, while debugging src/magento/vendor/magento/module-checkout/view/frontend/web/js/model/checkout-data-resolver.js:58

Expected result

resolveEstimationAddress method has correct, selected, shipping address taxes calculated correctly

Actual result

resolveEstimationAddress method has new shipping address, even though it is not selected taxes calculated correctly, for incorrect new address

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @ksenia-zlotin. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. 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:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Hotel. 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:

engcom-Hotel commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Hotel. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Hotel, here is your Magento Instance: https://11ea88a20724976e58d029fe0ae55bd2.instances-prod.magento-community.engineering Admin access: https://11ea88a20724976e58d029fe0ae55bd2.instances-prod.magento-community.engineering/admin_adb9 Login: 2ccf8d80 Password: bb06f9e0fe26

engcom-Hotel commented 1 year ago

Hello @ksenia-zlotin,

Thanks for the report and collaboration!

We have tried to reproduce the issue in the latest development branch 2.4-develop, and the issue seems reproducible for us. Please have a look at the below screenshots for reference:

  1. Here in the below screenshot, first we have created and selected the new shipping address and then back to the Shipping address and select the default shipping address, and pressed the "Next" button, after that if try to access the cart page the address variable contains the new shipping address:

    image
  2. In the below screenshot, you can see we have selected the default shipping address:

    image

But we can place the order successfully with the selected shipping address, so please let us know the use case where you are facing an issue with the current flow.

Thanks

ksenia-zlotin commented 1 year ago

Try and create two tax rates - one for the default address with price x and one for the new shipping address with price y. You will see cart applies tax rate Y even though you selected default address. The cart shows incorrect tax calculations to the customer. It should always be correct - regardless of the fact they can place the order successfully. Numbers matter.

engcom-Hotel commented 1 year ago

Hello @ksenia-zlotin,

Thanks for the clarification!

As per your comment, we have created 2 addresses one for NY and another for CA and the issue is reproducible for us. The tax calculation on the cart page is not correct. Please refer to the below screenshots for reference:

At the time of checkout (First Time): The tax amount shows $16.50

image

Again Go back and change the address with NY: The tax amount shows $16.75

image

Go back to the cart page: The tax amount shows $16.50, it should be $16.75

image

But at the time of final checkout, the tax amount shows the correct amount. That means we need to fix it for only the cart page.

Hence confirming the issue.

Thanks

github-jira-sync-bot commented 1 year ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-8541 is successfully created for this GitHub issue.

m2-assistant[bot] commented 1 year ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Vikaashkarthick-K commented 1 year ago

@magento I am working on this

Vikaashkarthick-K commented 1 year ago

@magento add to contributors team

m2-assistant[bot] commented 1 year ago

Hi @Vikaashkarthick-K! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

Vikaashkarthick-K commented 1 year ago

@magento I am working on this

Vikaashkarthick-K commented 1 year ago

As per the comments, I have created 2 addresses one for NY and another for CA and the issue is reproducible for me. The tax calculation on the cart page is not correct.

Please refer to the below screenshots for reference:

At the time of checkout (First Time): The tax amount shows $6.56 image

Again Go back and change the address : The tax amount shows $2.19 image

Go back to the cart page: The tax amount shows $2.91, it should be $2.19 image

Hence, the issue is reproducible.