- Issue created by @kopeboy
- 🇭🇺Hungary djg_tram
That's true and a good catch, I created it on a site where shipping was present and I never actually realized that this is an extra dependency. We have to look into how we can make it optional. Actually, none of processors mentioned there is essential. If you look into the code, they're purely there to put their calls inside a try-catch block. The stock Commerce merely throws a `CurrencyMismatchException`, resulting in a WSOD, if the cart has items in more than one currency, I only wanted to avoid that and show a regular, user friendly error message instead of the WSOD. So, in your particular case, you should be able to simply comment out `commerce_currencies.safe_early_order_processor` and `commerce_currencies.safe_late_order_processor` without any further issue.
I never decorated an existing class conditionally. Now that I googled for it, maybe https://www.drupal.org/docs/drupal-apis/services-and-dependency-injectio... → would be the solution?
- 🇺🇸United States mrweiner
Simpler option might be to just add additional submodules for each additional dependency. So one for each of tax, shipping, and promotions.
- 🇭🇺Hungary djg_tram
I don't see what benefit hook_install would provide in this case. It's really only about a single try-catch, nothing else.
- 🇺🇸United States mrweiner
I was assuming that you were using hook_install here. My thought was just for e.g. if somebody installed commerce_currencies, and then subsequently installed commerce_shipping, the price field on shipments might not be updated as expected. But this might be moot depending on how commerce_currencies works.
- 🇭🇺Hungary djg_tram
I'll try to find some time to add the conditional handling in the coming days...