Implements exchangerIsEnabled() function that was introduced in #3177803

PriceExchangerCalculator class is now extending DefaultExchangerCalculator instead of AbstractExchangerCalculator since DefaultExchangerCalculator is already extending AbstractExchangerCalculator.

Patch forthcoming...

Comments

Ahmed_Samir created an issue. See original summary.

ahmed_samir’s picture

Status: Active » Needs work
StatusFileSize
new1.06 KB
ahmed_samir’s picture

Status: Needs work » Needs review
valic’s picture

Status: Needs review » Needs work

There is no need to extend DefaultExchangeCalculator while we override immediately his only function implementation.

We can leave the Abstract class to be extended, and the second line is fine, resolver is not taking into consideration if the exchanger plugin is enabled or not

  • valic committed 7085281 on 8.x-1.x authored by Ahmed_Samir
    Issue #3177809 by Ahmed_Samir, valic: Compatibility with changes in...
valic’s picture

Status: Needs work » Fixed

Added your change that the provider needs to enabled to be taken into account.

About your specific case from an issue on commerce_exchanger, I suggest that you overwrite this module service
commerce_currency_resolver.calculator as described here https://www.drupal.org/docs/drupal-apis/services-and-dependency-injectio...

For the future maybe introduction a proper resolver for exchange price calculator would be better, so anyone could write their own, but on another hand, it still seems like overkill

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.