algoliasearch-magento-2
algoliasearch-magento-2 copied to clipboard
Fix double currency conversion for configurable products
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 ingetMinMaxPrices() - 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