Repository navigation
chore: handle B2B users scenario - initial location - #2760
Merged
Merged
Conversation
lucasfp13
requested review from
hellofanny and
renatamottam
and removed request for
a team
April 2, 2025 18:03
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
lariciamota
reviewed
Apr 2, 2025
lariciamota
force-pushed
the
feat/delivery-promise
branch
from
April 8, 2025 12:46
a28d534 to
8fbe4f1
Compare
3 tasks
Contributor
|
@lucasfp13 this PR is blocked for now right? Can we convert to |
lariciamota
force-pushed
the
feat/delivery-promise
branch
from
April 11, 2025 17:59
8805012 to
c540749
Compare
lariciamota
force-pushed
the
feat/delivery-promise
branch
from
April 22, 2025 14:00
c540749 to
b0aa3d3
Compare
lucasfp13
marked this pull request as draft
April 30, 2025 18:07
lariciamota
force-pushed
the
feat/delivery-promise
branch
2 times, most recently
from
May 12, 2025 18:11
789c99a to
b41c2a9
Compare
lucasfp13
force-pushed
the
chore/b2b-saved-addresses
branch
from
May 16, 2025 16:51
87107af to
cdb12e7
Compare
hellofanny
reviewed
Jun 20, 2025
hellofanny
reviewed
Jun 20, 2025
hellofanny
marked this pull request as ready for review
June 24, 2025 01:01
lucasfp13
commented
Jun 24, 2025
lucasfp13
left a comment
Contributor
Author
There was a problem hiding this comment.
I can't approve, but LGTM!
hellofanny
approved these changes
Jun 24, 2025
lariciamota
reviewed
Jun 25, 2025
lariciamota
reviewed
Jun 25, 2025
lariciamota
reviewed
Jun 27, 2025
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
then use postalCode in session
Co-authored-by: Larícia Mota <[email protected]>
hellofanny
force-pushed
the
chore/b2b-saved-addresses
branch
from
June 27, 2025 16:24
5e7821e to
fd74310
Compare
checks B2B default postal code in Core instead of API
lariciamota
reviewed
Jul 1, 2025
hellofanny
force-pushed
the
chore/b2b-saved-addresses
branch
from
July 1, 2025 22:38
de20be5 to
6180ab0
Compare
Contributor
lariciamota
approved these changes
Jul 2, 2025
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.

What's the purpose of this pull request?
Gets user's saved location if logged in (for b2b org scenario)
Unlike b2c approach, where we use the address query, we should try setting the initial location using the postal code from the session (if valid)
How to test it?
discovery.config, change account tob2bfaststoredevand enable delivery promise;b2bobject.note: if the saved postalCode is not valid, the session won't be updated, and you should see a validateSession error in console.
This test account only accepts valid U.S. postal codes.
PS: Need to check with the B2B team if the changes on our side are still needed.