Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Dec 18, 2023
1 parent f072369 commit 8efb698
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Traits/InteractsWithItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
});

Expand Down

0 comments on commit 8efb698

Please sign in to comment.