New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Total price is wrong when product has price options in config with currency conversion #2342
Comments
If you debug The converted surcharge is being retrieved in line core/system/modules/isotope/library/Isotope/Frontend.php Lines 726 to 735 in 175a07f
The already wrong result is then converted one more time in core/system/modules/isotope/library/Isotope/Isotope.php Lines 252 to 262 in 175a07f
|
can you please check if e271209 fixes the problem? |
Yes, this logic fixes it. However, I fixed it in a different place in my project: core/system/modules/isotope/library/Isotope/Model/AttributeOption.php Lines 183 to 190 in b44de9a
public function getAmount($fltPrice, $intTaxClass)
{
if ($this->isPercentage()) {
return $fltPrice / 100 * $this->getPercentage();
}
--- return Isotope::calculatePrice($this->price, $this, 'price', $intTaxClass);
+++ return $this->price;
} For two reasons:
What do you think? |
I understand, but I'm not sure that's a good idea. People might use that method since it is public API. Also, all other |
Pretty funny but serious bug. If you have a store config with a currency conversion, and a product with customer defined price options (i.e. those that add surcharge when selected in frontend) – the total price is calculated incorrectly.
Reproducible in Isotope Demo.
Details
Price factor
is not1
+0.00
+50.00
100.00
The default result in frontend (without currency conversion) is: product is displayed with total price of
100.00
and two options –0.00
and50.00
. When you select 2nd option, price changes to150.00
.Now switch to the new config. From the screenshot on the left you would expect the total price of "Premium" to be
153.20
, but you can see it was miscalculated on the right screenshot.I understand, that this was probably easy to miss when testing on Isotope Demo, because
Price factor
s are close to1
there. I'm building a shop with a conversion like0.0175
(something like1 to 57
), and I now get ridiculous prices for surcharged options, like529.212,00
instead of48.789,00
, so it is finally noticeable.The text was updated successfully, but these errors were encountered: