Repository navigation
fix(checkout): guest signup leaves no order history and breaks later … - #5
Merged
Merged
Conversation
…orders Guest checkout's place_order() created the new Customer without a Portal User row, so the storefront order-history page (which finds the Customer via Portal User, not Contact) showed no orders for a customer who had just signed up - not even their own first one. create_party() now adds the Portal User row, matching what the standalone /register flow already did. Separately, Frappe auto-creates a Contact for every new User via a background job that can race storekit's own Contact creation during checkout, leaving two Contact rows for one email - one linked to the new Customer, one not. get_party() had no way to prefer the right one, so a later visit could land on the unlinked Contact and silently spin up a second, empty Customer whose address didn't match the one saved at signup - surfacing as "Something went wrong" on the next order. Added _resolve_contact_for_email() to prefer a linked Contact over an unlinked one, and used it in get_party(), create_contact() and _get_cart_quotation(). Release 1.1.1.
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.
…orders
Guest checkout's place_order() created the new Customer without a Portal User row, so the storefront order-history page (which finds the Customer via Portal User, not Contact) showed no orders for a customer who had just signed up - not even their own first one. create_party() now adds the Portal User row, matching what the standalone /register flow already did.
Separately, Frappe auto-creates a Contact for every new User via a background job that can race storekit's own Contact creation during checkout, leaving two Contact rows for one email - one linked to the new Customer, one not. get_party() had no way to prefer the right one, so a later visit could land on the unlinked Contact and silently spin up a second, empty Customer whose address didn't match the one saved at signup - surfacing as "Something went wrong" on the next order. Added _resolve_contact_for_email() to prefer a linked Contact over an unlinked one, and used it in get_party(), create_contact() and _get_cart_quotation().
Release 1.1.1.