Skip to content

@W-20002879 Register guest save addresses is multi-ship aware#3412

Merged
patricksullivansf merged 4 commits intodevelopfrom
psullivan.W-20002879.multishipRegisterAddresses
Oct 21, 2025
Merged

@W-20002879 Register guest save addresses is multi-ship aware#3412
patricksullivansf merged 4 commits intodevelopfrom
psullivan.W-20002879.multishipRegisterAddresses

Conversation

@patricksullivansf
Copy link
Contributor

Description

When a guest user completes checkout they have the option to create an account on the order confirmation page. The new account should have all the delivery shipping addresses and none of the pick up in store addresses from the newly created guest order.

Before this fix, only the first shipment address was saved and if it wad a pick-up order the store address was incorrectly saved as the customer address.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

Steps to reproduce:

  1. Add 1 item for store pickup then 2 separate items for ship to address (other variations create different wrong results)
  2. Checkout as guest using a new Email Address
  3. Add 2 different addresses for the 2 shipping items.
  4. Proceed to place order.
  5. Register a new account on Order Confirmation Page
  6. Go to address book

Observe no store addresses are saved and other 2 addresses are saved

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Oct 21, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Licenses 0 0 0 0 0 issues
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@patricksullivansf patricksullivansf marked this pull request as ready for review October 21, 2025 17:06
@patricksullivansf patricksullivansf requested a review from a team as a code owner October 21, 2025 17:06
})
})

test('does not save pickup addresses when store locator is enabled', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make more sense to also have a test that only "delivery" addresses are saved in the user’s address book? It is kind of inferred here though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, renamed the test to be more clear

Copy link
Contributor

@sf-henry-semaganda sf-henry-semaganda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

const {id, _type, ...shippingAddressWithoutId} = shippingAddress
const bodyShippingAddress = {
addressId: nanoid(),
...shippingAddressWithoutId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ...omit(shippingAddress, ['id', '_type'])

@patricksullivansf patricksullivansf merged commit baa0359 into develop Oct 21, 2025
42 checks passed
@patricksullivansf patricksullivansf deleted the psullivan.W-20002879.multishipRegisterAddresses branch October 21, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants