-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TaxZoneStrategy does not allow for taxZone determination by Order data #1048
Comments
Another option that would make it more extensible is making the function async. The function is being called alot of times, so this would have a performance impact (depending on the implementation). Could we then limit the calls to |
I just noticed that
We could also seperate these into 2 functions:
This probably has some implications I didn't foresee, but it's food for thought 👍 |
Hi Martin, Thanks for your suggestions on this. Some thoughts:
|
Relates to #1048. This commit also introduces the use of RequestContextCacheService to optimize the number of calls made to the `determineTaxZone()` method, as well as allowing async return values.
Describe the bug
TaxZoneStrategy does not allow for taxZone determination by Order data, because the final call to
determineTaxZone
is without order. Without theorder
argument, you'd have to resort back to a default zone, resulting in always having the defaultTaxZone on your order.For example, when we try to determine taxZone by shippingAddress with the following code:
To Reproduce
Steps to reproduce the behavior:
undefined
because there is no order given, so the taxZone will always be the channel.defaultTaxZoneExpected behavior
undefined
fromdetermineTaxZone
, meaning the taxZone should not be changedEnvironment (please complete the following information):
Additional context
Slack conversation: https://vendure-ecommerce.slack.com/archives/CKYMF0ZTJ/p1629468594214100
The text was updated successfully, but these errors were encountered: