-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow customer_id in UpdateCart #9387
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect to see:
- A test
- Some considerations around edge cases - e.g. update has both customer_id and email. Which one dictates the customer on the cart?
assume this is for the b2b starter - is it maybe better to add a custom endpoint?
@VariableVic, can I get you to address the comments, so we can move forward with this? |
The issue is that carts are not properly linked to existing customers with an account because we can't pass in a customer_id for logged in customers. Instead, a new anonymous customer is created with the same email, and linked to the cart. AFAICT the workflow expects a customer_id to be present for customers with an account. When passing in an email, the workflow will only look for customers that don't have an account (
This is taken care of in findOrCreateCustomerStep - the workflow accounts for receiving both email and customer id.
I have no experience writing these tests. Maybe @riqwan can help out? I don't think this is a B2B starter specific issue, that's why we decided to open the PR. |
Whats the expected outcome here? If the Only case I can think of is when you run 2 requests:
In this case ^ do we update the customer's email, but keep the customer_id? and vice versa, do we override the email? Alternatively, we remove |
The expected outcome is that we can update a cart for a logged in customer. This is currently impossible. I think that when a customer is logged in, the customer_id and email from the customer record should always be used on the cart. |
Allows
customer_id
to be present when updating a cart.