From 4fe0b408e15fb79b90a3e60589b75d6a7d84a8e1 Mon Sep 17 00:00:00 2001 From: Benjamin Hubert Date: Fri, 13 Apr 2018 16:57:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Helper/Cart/CartManager.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Helper/Cart/CartManager.php b/Helper/Cart/CartManager.php index 8933a7c..450b134 100644 --- a/Helper/Cart/CartManager.php +++ b/Helper/Cart/CartManager.php @@ -182,17 +182,19 @@ public function getTotal( ); } - if ($withCartDiscount) { - $discount = $this->getCartDiscount(); - $total -= $this->priceHelper->getDiscountAmount($total, $discount); - } - if ($withShipment && null !== $shipment = $cart->getShipment()) { $total += $shipment->getPrice(); } + $total = round($total, 2); + + if ($withCartDiscount) { + $discount = $this->getCartDiscount(); + $total -= round($this->priceHelper->getDiscountAmount($total, $discount), 2); + } + if (!empty($withTaxes)) { - $total += ($total * $withTaxes / 100); + $total += round(($total * $withTaxes / 100), 2); } return $total;