From e5ee965c88efdf5f64ab782c1d873a8bd6375ae2 Mon Sep 17 00:00:00 2001 From: der_On Date: Tue, 21 Jun 2022 17:57:59 +0200 Subject: [PATCH] Uses rounding precision of 4 to store cart item prices resolves #6501 This prevents rounding errors after applying taxes. --- packages/Webkul/Product/src/Type/AbstractType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index e8dbdbc89..f90238721 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -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;