Magento 2 : Currency Switcher Show Wrong Price For Configure Product
-
07-10-2020 - |
Question
I have multi currency in website but when I change currency over configured product. It is showing wrong price after change currency.
La solution
This magento2 bug.
Path: vendor\magento\module-catalog\Block\Product\View.php Line: 237-259
You need replace below code.This is a temporary fix. Please upgrade to the latest version if it is not working.
$config = [
'productId' => $product->getId(),
'priceFormat' => $this->_localeFormat->getPriceFormat(),
'prices' => [
'oldPrice' => [
'amount' =>
$product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue()
,
'adjustments' => []
],
'basePrice' => [
'amount' =>
$product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount()
,
'adjustments' => []
],
'finalPrice' => [
'amount' =>
$product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue()
,
'adjustments' => []
]
],
'idSuffix' => '_clone',
'tierPrices' => $tierPrices
];
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange