You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes the price to 16.000000 (it's multiplied by 4.000000 again) - and that's the issue. I think it would be better to check if we are not iterating over the same currency, or at least ensure that it won't be recalculated again, for example like this:
It seems that the module incorrectly calculates currencies. See the explanation below:
Let's say we have a multistore with the following configuration:
Product prices are in EUR.
Shop A
(main one - ID = 1):EUR
.Shop B
(ID = 2):PLN
(PLN exchange rate set to: 4.000000)PrestaShop
will return 4 PLN as the default price for this product.Now, the code:
doofinder-prestashop/src/Entity/DfTools.php
Line 1442 in 9c813f5
The value of
$price
is4.000000
in the case ofShop B
.Later, the module does this:
doofinder-prestashop/src/Entity/DfTools.php
Lines 1445 to 1448 in 9c813f5
It iterates over all currencies (including PLN). As a result, this line:
Changes the price to 16.000000 (it's multiplied by 4.000000 again) - and that's the issue. I think it would be better to check if we are not iterating over the same currency, or at least ensure that it won't be recalculated again, for example like this:
Of course, the changes above are only for visual representation of the problem; it's not a good looking/proper way to solve this issue.
The text was updated successfully, but these errors were encountered: