algoliasearch-magento-2 icon indicating copy to clipboard operation
algoliasearch-magento-2 copied to clipboard

Fix double currency conversion for configurable products

Open matteo-oliunid opened this issue 5 months ago • 0 comments

Description

Fixes double currency conversion issue for configurable products that caused incorrect prices in non-base currencies (e.g., AUD prices were double-converted from EUR).

Problem

  • Configurable products had prices converted twice: once in getSpecialPrice() and again in getMinMaxPrices()
  • This resulted in incorrect prices like: 122.05 EUR → 214.15 AUD → 375.76 AUD (double conversion)

Solution

  • Modified getSpecialPrice() to only convert currencies for simple products
  • Configurable products now rely on getMinMaxPrices() for currency conversion
  • Added condition: (!$subProducts || count($subProducts) === 0) to determine conversion logic

Testing

  • [x] Tested with configurable products in AUD/USD currencies
  • [x] Verified simple products still work correctly
  • [x] Confirmed no double conversion in logs

matteo-oliunid avatar Jun 11 '25 10:06 matteo-oliunid