From 8efb698a3d3661b91ff984229d22fe4ba74a6a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Mon, 18 Dec 2023 15:48:30 +0100 Subject: [PATCH] wip --- src/Traits/InteractsWithItems.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Traits/InteractsWithItems.php b/src/Traits/InteractsWithItems.php index c97d645f..b181cf12 100644 --- a/src/Traits/InteractsWithItems.php +++ b/src/Traits/InteractsWithItems.php @@ -207,12 +207,10 @@ public function getCurrency(): string */ public function getTotal(): float { - $value = $this->items->sum(static function (LineItem $item): float { + $value = $this->taxables->sum(static function (LineItem $item): float { return $item->getTotal(); }); - $value += $this->shipping->getTotal(); - $value -= $this->discount; return round($value < 0 ? 0 : $value, 2); @@ -271,7 +269,7 @@ public function getFormattedFeeTotal(): string */ public function getTax(): float { - $value = $this->lineItems->sum(static function (LineItem $item): float { + $value = $this->taxables->sum(static function (LineItem $item): float { return $item->getTax() * $item->getQuantity(); });