From 997011ed29a30fc238595b5ea67494fd718bfff9 Mon Sep 17 00:00:00 2001 From: Nicolas Gorga Date: Sun, 9 Nov 2025 21:54:35 -0300 Subject: [PATCH 1/2] Avoid overriding region and customer from pricing context hook result if provided --- .../src/cart/workflows/get-variants-and-items-with-prices.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts b/packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts index f82931cc03994..47e3285124727 100644 --- a/packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts +++ b/packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts @@ -105,12 +105,12 @@ export const getVariantsAndItemsWithPrices = createWorkflow( const cart = data.cart const baseContext = { ...filterObjectByKeys(cart, cartFieldsForPricingContext), + customer: cart.customer, + region: cart.region, ...(data.setPricingContextResult ? data.setPricingContextResult : {}), currency_code: cart.currency_code ?? cart.region?.currency_code, region_id: cart.region_id, - region: cart.region, customer_id: cart.customer_id, - customer: cart.customer, } return (data.items ?? cart.items ?? []) From c2faa23591f8e258d07d81ed1879c0e26594a4a2 Mon Sep 17 00:00:00 2001 From: Nicolas Gorga Date: Sun, 9 Nov 2025 21:56:03 -0300 Subject: [PATCH 2/2] Add changeset --- .changeset/smart-stamps-shake.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/smart-stamps-shake.md diff --git a/.changeset/smart-stamps-shake.md b/.changeset/smart-stamps-shake.md new file mode 100644 index 0000000000000..76f141f5f3221 --- /dev/null +++ b/.changeset/smart-stamps-shake.md @@ -0,0 +1,5 @@ +--- +"@medusajs/core-flows": patch +--- + +fix(core-flows): avoid overriding customer and region from setPricingContext hook result