The error message you get is due to a typo in the code (there’s a call to InvalidArgumentException
, where it should be \InvalidArgumentException
). Fixing that will be simple enough, I will add this to the next update. However, there’s still the underlying issue of the currencies, which is the reason why the InvalidArgumentException
is thrown in the first place.
The EU VAT Assistant only supports our Aelia Currency Switcher for the multi-currency aspect (there are other plugins with the same name, but they are not ours and not supported by us).
When the EUVA loads the exchange rates, it queries the Currency Switcher to find out which currencies are enabled in it, and fetches the rates for those currencies.
If the Currency Switcher is not installed, then the EU VAT Assistant will only handle the shop’s base currency. Due to that, when you try to place an order in another currency, the EU VAT Assistant doesn’t have an exchange rate and throws an error. The error you will see will be something like “Currency conversion – Source currency not valid or exchange rate not found for: “USD”. Please make sure that the EU VAT assistant plugin is configured correctly and that an Exchange Rate has been specified for each of the available currencies.”
How to fix the issue
As indicated, the EU VAT Assistant was only tested with our Aelia Currency Switcher. Installing it will solve the issue.
If you don’t want to use that plugin, you can try implementing a filter for the wc_aelia_cs_enabled_currencies
hook. Your filter should return an array of currency codes, as in the following example:
add_filter('wc_aelia_cs_enabled_currencies', function($currencies) {
// Add currencies as needed
return array('EUR', 'USD', 'GBP', 'AUD');
}, 10, 1);
Please note that, while this filter should remove the original cause of the error message, we can’t guarantee that this will be sufficient to solve all multi-currency related issues. As of today, multi-currency plugins other than our Currency Switcher are not supported.