chore(medusa,pricing): add support for sales_channel_id as a pricing preference context for determining tax inclusivity.#15006
Conversation
🦋 Changeset detectedLatest commit: eb060f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 77 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@pepijn-vanvlaanderen is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for your contribution! After reviewing this PR, we need a few things addressed before we can move forward: Required changes:
Notes: The |
Summary
What — What changes are introduced in this PR?
Adds support for sales_channel_id as a pricing preference context for determining tax inclusivity.
Why — Why are these changes relevant or necessary?
Previously, the tax inclusivity of a price could only be determined by region_id or currency_code. Sales channels may have different tax-inclusive pricing requirements, i.e. a B2B sales channel, and there was no way to express this preference.
How — How have these changes been implemented?
Three changes in pricing-module.ts:
sales_channel_idis now included in the preference context filter alongsideregion_idandcurrency_code.isTaxInclusivehelper now receives the fullpricingContextinstead of justregion_id, allowing it to extract additional context keys.salesChannelPreferencelookup is added, and if matched, it takes precedence over region/currency preferences.Testing — How have these changes been tested, or how can the reviewer test the feature?
Patched in (production) projects and validated accuracy.
Examples
Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.
This helps with documentation and ensures maintainers can quickly understand and verify the change.
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the prompts