You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When you want to support multiple currencies, the "right" way is with multiple channels, creating a 1:1 mapping of channels to currencies, even if you don't want to take advantage of any of the other features of channels. Then, if you care about the pricing in one currency (e.g. USD if your company is US-based), you need to update the pricing on every channel every time the exchange rate changes.
Describe the solution you'd like
As a P0, I would like to see support for multiple currencies per product variant.
As a P1, my ideal solution would allow setting a default currency for a channel, make the price denominated in that currency, and allow setting a list of alternate currencies and exchange rates. An admin API mutation could be updateCurrencyExchangeRates so a developer could create a separate currency exchange rate server that fetches exchange rates from wherever the developer desires, and updates the exchange rates in Vendure so pricing can be automatically updated by a shop frontend.
As a P2, extend this functionality to allow setting a preferred currency on a user, to make it easier to show a user's preferred currency on a shop frontend.
Describe alternatives you've considered
The frontend can fetch exchange rates and display prices in any currency, but this is only safe if the payment is going to be processed in the currency used in Vendure, because otherwise there's no way to ensure that an order is completely paid for.
A secondary server can be set up, or an custom extension built into Vendure to add an API that essentially acts as middleware implementing this functionality. The storefront would call Vendure directly for product and order information, but then make a second call to this custom API to convert prices to the user's preferred currency. Then for payment, a custom payment provider would need to be written as well to handle ensuring payment made in the currency not stored in Vendure is handled appropriately.
Additional context
I saw a conversation about this on Slack a few months ago where a feature request was suggested for V2, but then I didn't find one here, so I'm creating this. Happy to collaborate on the design if this seems like a reasonable general direction.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed write-up on this. I agree that it would be good to support this, since Channels have additional overheads that one should not need to take on just to support multiple currencies.
In theory we already have much of the data model in place to support this, since ProductVariant -> ProductVariantPrice is already a one-to-many relationship. This is how we support price-per-channel currently. It should not take too much work to make this price-per-channel-currency, i.e. adding a currencyCode property to the ProductVariantPrice entity.
I like the idea of a configurable exchange rate update mechanism too. I think this could be done either via a mutation as you suggest, or also by exposing a service so that e.g. a CLI script can do this as a cron job directly without the need for a network call. That aspect would be another use-case for #1425.
Relates to #1691
This change puts in place a data model which will allow us to support multiple currencies per
channel, and will remove the requirement that a new price be set for
each channel that a variant is assigned to.
BREAKING CHANGE: The `Channel.currencyCode` field has been renamed to `defaultCurrencyCode`, and a
new `currencyCode` field has been added to the `ProductVariantPrice` entity. This will require
a database migration with care taken to preserve exiting data.
Relates to #1691
This adds a new configurable strategy which allows you to define the logic by which a variant price
is selected based on factors like active channel and currency code.
Is your feature request related to a problem? Please describe.
When you want to support multiple currencies, the "right" way is with multiple channels, creating a 1:1 mapping of channels to currencies, even if you don't want to take advantage of any of the other features of channels. Then, if you care about the pricing in one currency (e.g. USD if your company is US-based), you need to update the pricing on every channel every time the exchange rate changes.
Describe the solution you'd like
As a P0, I would like to see support for multiple currencies per product variant.
As a P1, my ideal solution would allow setting a default currency for a channel, make the price denominated in that currency, and allow setting a list of alternate currencies and exchange rates. An admin API mutation could be
updateCurrencyExchangeRates
so a developer could create a separate currency exchange rate server that fetches exchange rates from wherever the developer desires, and updates the exchange rates in Vendure so pricing can be automatically updated by a shop frontend.As a P2, extend this functionality to allow setting a preferred currency on a user, to make it easier to show a user's preferred currency on a shop frontend.
Describe alternatives you've considered
The frontend can fetch exchange rates and display prices in any currency, but this is only safe if the payment is going to be processed in the currency used in Vendure, because otherwise there's no way to ensure that an order is completely paid for.
A secondary server can be set up, or an custom extension built into Vendure to add an API that essentially acts as middleware implementing this functionality. The storefront would call Vendure directly for product and order information, but then make a second call to this custom API to convert prices to the user's preferred currency. Then for payment, a custom payment provider would need to be written as well to handle ensuring payment made in the currency not stored in Vendure is handled appropriately.
Additional context
I saw a conversation about this on Slack a few months ago where a feature request was suggested for V2, but then I didn't find one here, so I'm creating this. Happy to collaborate on the design if this seems like a reasonable general direction.
The text was updated successfully, but these errors were encountered: