- Issue created by @andriic
- Merge request !440Issue #3521073: respect quantity param in ChainPriceResolver β (Open) created by andriic
The quantity param for ChainPriceResolver service collector is not working.
The issue is that DefaultPriceResolver will always be first in the list.
In our project we have custom implementation of multiprice per store where prices are stored in the custom field.
The error occurs when we try to add an order item with DKK currency to the order which already have order items with USD currency.
Calculation of the total order price fails with
Drupal\Core\Entity\EntityStorageException: The provided prices have mismatched currencies: 123 USD, 333 DKK. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 816 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
In another task #3521071 π The provided prices have mismatched currencies Active I've already proposed a solution to fix mismatched currencies fatal, but for our multiple currencies implementation it will not work.
To fix this issue we need a price resolver which will be executed before default one and will provide the correct price.
That's why the priority parameter is important.
Active
3.0
Price