-
Notifications
You must be signed in to change notification settings - Fork 293
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
[Feature]: Support nested price conversion #1697
Conversation
818b905
to
14513ff
Compare
Hi, thank you for the PR. To allow for multiple currency conversions, I prefer a more explicit approach where one either explicitly adds additional prices via a plugin (as is already possible) or by explicitly specifying the currencies to convert via/to. With #1732 the latter will also be possible. Also, the implementation here does not seem very performant, on some reports the load times seem to have doubled. So I do not intend to merge your PR - does #1732 also work for your use case? |
I use the master branch, But can't find the correct way to use #1732. I have a long list of price directive created by bean-price daily. I want all Other currency be converted into CNY when I choose converted to CNY. |
If you have conversion rates from your other currencies to, e.g., HKD (and then prices for HKD in CNY), you could choose HKD,CNY as conversions to get everything converted to CNY. |
You can select multiple currencies from that dropdown |
OK, I understand it now. The order in which I select affects the conversion. My pr uses the Bellman–Ford algorithm to find the shortest path, which makes it slow, while the current solution requires the user to find the correct path. I think the UI does not inform the user that the selection order would affect the results. I have a question while I am devloping locally. How to set up the translations... It seems to require a POEDITOR_TOKEN |
Exactly - it also allows/requires the user to pick a specific path. Finding shouldn't normally be hard AFAIKT, since it will usually be just via your operating currencies.
That's why I added a help page to describe it - I don't think this can be easily shown in the UI
No, that token is only necessary to update the translations from poeditor.com (where they are edited). If you want to edit the translations, you'll have to do so at poeditor. |
Support nested price conversion Related issue #1407
Always convert to biggest value using Bellman–Ford algorithm.
For example, when using convert to HKD, find the shortest(Smallest Conversion Rate) from HKD to others currency.$K$ $\frac{1}{K}$ (largest)
then the price from others to HKD is