I want to have the "currency source" set to "Price field per currency". My understanding is that I don't need any kind exchange rate process in that case. However, it is a mandatory field and hence I can't submit the form without selecting an option.
Also, the Exchange Rate API field is empty so it is actually not even possible to select a default option to submit the form.
Comments
Comment #2
vbouchetPlease find a tentative patch.
It uses the states API to display and make the currency_exchange_rates field required only if currency_source is "auto" or "combo".
I removed the disable for the submit form as it won't submit anyway when the currency_exchange_rates is visible but not filled (as required).
Comment #3
vbouchetComment #4
valicMost of the module relies on having an exchange service.
There are not only prices per product, but also promotions, shipping rates, etc..
You need to have set up at least one exchange rate. This is hard requirement for this module.
Also, if you leave one field empty accidentally, the module still is going to fallback to auto-calculating price.
Comment #5
valicWithout having set exchange rate service you are going to encounter more errors.
If you don't need exchange service or you think it will not be used anytime, you still can create a manual plugin for exchanger
(there is no need to have 3rd party service)
Comment #6
vbouchetHi Valic, thanks for the quick reply. I understood that a little bit later after the patch as I faced one of the error you probably had in mind. ;-) I am not sure it make sense to have a "field" only option given the code is actually doing the "combo" process whatever.
Comment #7
valicYes, it is a bit redundant. The module does not add the field directly and does not force them to be required.
So decided at one point to set that as a fallback
Comment #8
valicThere was one specific recent requirement similar to this, link that issue below.
And assigning issue to me. We could maybe do something for version 2.x.
1.x is not getting anymore bigger changes
Comment #9
valicComment #10
valicChanging the title to reflect the task better
Comment #11
valicLet's tackle this for v 2.x
Comment #12
rajivgandhi chinnakrishnan commentedWe have added the patch in the commerce exchanger module. https://www.drupal.org/project/commerce_exchanger/issues/3177803#comment...
To make that work, the below patch needs to be added in commerce_currency_resolver. Otherwise, we will get the below error,
Fatal error: Class Drupal\commerce_currency_resolver\PriceExchangerCalculator contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\commerce_exchanger\ExchangerCalculatorInterface::exchangerIsEnabled) in /var/www/html/web/modules/contrib/commerce_currency_resolver/src/PriceExchangerCalculator.php on line 12Comment #13
valicNow with version 2.0 exchanger is not required anymore.
Please refer to the release and change record
https://www.drupal.org/project/commerce_currency_resolver/releases/2.0.0
Comment #14
valic