ChainPriceResolver quantity param is not working

Created on 24 April 2025, about 5 hours ago

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.

πŸ› Bug report
Status

Active

Version

3.0

Component

Price

Created by

πŸ‡ΊπŸ‡¦Ukraine andriic

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024