Magenerds / BasePrice

37 stars 38 forks source link

Base price result wrong when prices in backend catalog are excl. tax but display inc. tax #13

Closed violuke closed 6 years ago

violuke commented 6 years ago

The same as #6.

Prices entered into the admin without tax, but displayed on the website with tax have the wrong base price shown. I'll try to resolve it, but if anyone else can help that would be much appreciated.

bug

violuke commented 6 years ago

I don't know if this will work properly for other scenarios regarding tax display/admin input but I resolved this for us by changing line 128 of Magenerds/BasePrice/Helper/Data.php from

$productPrice = $product->getFinalPrice();

to

$productPrice = (string)round((string)$product->getPriceInfo()->getPrice('final_price')->getAmount(), 4);
sydekumf commented 6 years ago

Thanks for the report, we fixed it :-)