-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat(core-flows, types): update shipping methods upon cart ops #10382
Conversation
… as pricing context
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Skipped Deployments
|
|
packages/core/core-flows/src/cart/steps/update-shipping-methods.ts
Outdated
Show resolved
Hide resolved
packages/core/core-flows/src/cart/steps/refresh-cart-shipping-methods.ts
Show resolved
Hide resolved
integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
Outdated
Show resolved
Hide resolved
packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts
Outdated
Show resolved
Hide resolved
packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts
Outdated
Show resolved
Hide resolved
@@ -71,7 +88,7 @@ export const listShippingOptionsForCartWorkflow = createWorkflow( | |||
) | |||
|
|||
const customerGroupIds = when({ cart }, ({ cart }) => { | |||
return !!cart.id | |||
return !!cart.customer_group_id |
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.
q: does the cart have a customer_group_id
? 🤔
@@ -271,9 +258,11 @@ medusaIntegrationTestRunner({ | |||
expect.objectContaining({ | |||
id: shippingOption.id, | |||
name: "Test shipping option", | |||
amount: 500, |
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.
nit: Think amount is still there right?
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.
Yes it is, will add that back.
@@ -39,6 +30,7 @@ export const listShippingOptionsForCartWorkflow = createWorkflow( | |||
"id", | |||
"sales_channel_id", | |||
"currency_code", | |||
"customer.groups.id", |
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.
question: If I am not mistaken, we have changed how customer group ID is passed in the pricing context – just want to make sure this is intentional.
We used to pass is as a top-level property:
{ ..., customer_group_id: "cusgrp_1234" }
Now, it seems we pass it via the cart:
{ cart: { customer: { groups: [ { id: "cusgrp_1234" } ] } } }
Is that correct, or have I missed something?
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.
This was leak from the draft work I had for the changes related to the customer groups i was talking about. Will revert this.
All of our customer group rules are set as the attribute customer_group_id
, which doesn't exist in the cart context. The second version you listed should be the actual rule path - customer.groups.id
. This needs a data migration on price lists and prices, along with some changes in the pricing module, so thought will open a separate PR.
what:
RESOLVES CMRC-752