Uses rounding precision of 4 to store cart item prices

resolves #6501
This prevents rounding errors after applying taxes.
This commit is contained in:
der_On 2022-06-21 17:57:59 +02:00 committed by GitHub
parent 80c860ad82
commit e5ee965c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -513,7 +513,7 @@ abstract class AbstractType
*/
public function getFinalPrice($qty = null)
{
return round($this->getMinimalPrice($qty), 2);
return round($this->getMinimalPrice($qty), 4);
}
/**
@ -887,7 +887,7 @@ abstract class AbstractType
return $result;
}
$price = round($item->product->getTypeInstance()->getFinalPrice($item->quantity), 2);
$price = round($item->product->getTypeInstance()->getFinalPrice($item->quantity), 4);
if ($price == $item->base_price) {
return $result;