-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Allow passing country
and currency
to Product.pricing
and ProductVariant.pricing
#4315
Comments
Will it affect product filtering? How to filter products by price without knowing taxes? |
We've talked about this, ideally passing |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Queries are one thing; the other is that we need to know the country in checkout mutations that check the stock quantity so that we can pick the right warehouse. We need to get rid of usages of Also, we currently use countries to determine a warehouse, but I think we want to have better granularity and e.g. allow to define warehouses per state (that would be the use case in the US). Does it also affect pricing queries @patrys? |
What I'm trying to achieve
We need to allow people to explicitly switch countries and have the correct prices displayed.
Current implementation relies on
request.country
but when using the GraphQL API it's always set to whatever GeoIP returned.Describe a proposed solution
Currently, the API looks like this:
I propose that we allow
country
andcurrency
to be passed explicitly and that we drop theMoney.localized
field:If a value is not given, use the store's default country or currency (instead of falling back to GeoIP).
If a currency is given, return values in that currency (using the currency exchange rates) or return
null
if unable to do so.If a country is given, calculate taxes according to that country's tax regulations.
The text was updated successfully, but these errors were encountered: