Repository navigation
Send the saved address selection when loading shipping rates in admin order create - #41722
Open
bluefairydevelopment wants to merge 1 commit into
Conversation
… order create (magento#41624) The "Select from existing customer addresses" dropdown sits outside the address fields container, so loadShippingRates() posted the edited address fields without customer_address_id. Editing a field clears the dropdown in the browser, but the quote kept the saved address id. On reorder, SaveHandler imports the saved address book entry over the shipping address on every quote save while it has a customer_address_id, so the next block reload (payment methods, totals) replaced the edited address and recomputed tax and shipping for the old one until the order was submitted. loadShippingRates() now sends the dropdown's value with the address, so an edited address is saved as a new one and an untouched saved address still picks up the latest address book data on reorder.
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On admin Reorder, after changing the shipping address (for example the state), the next block reload, such as Get available payment methods, recalculated tax and shipping for the old address-book address. The edited address only took effect on Submit Order.
"Select from existing customer addresses" sits outside the address fields container. So
loadShippingRates()posted the edited fields withoutcustomer_address_id. Editing a field clears the dropdown in the browser, but the quote kept the saved address id. With the session in reorder mode,SaveHandlerthen imports that address-book entry over the shipping address on every quote save (ACP2E-1826).loadShippingRates()now sends the dropdown's value with the address:Fixed Issues
Manual testing scenarios
It reproduces only when the original order is created in the admin, as in the issue: Same As Billing Address unticked, so the shipping address is saved to the address book. An order placed another way does not trigger it.
Before: tax goes back to 20%. After: it stays at 10%.
Tested on 2.4-develop (0af2ad9) in a browser. Integration:
ReorderTest::testReorderKeepsEditedShippingAddressandtestReorderSavedShippingAddressFollowsAddressBook. Jasmine:scripts.test.js(4 new specs).Props to PhanQuocPhu for the report and the video that showed the exact steps.
Contribution checklist