Skip to content

Commit

Permalink
fixed item with sub qty of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepolo committed Jan 30, 2020
1 parent b3d2579 commit e99ec80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function subItemsTotal($format = true, $taxedItemsOnly = false, $withTax
$total = 0;

foreach ($this->subItems as $subItem) {
$total += $subItem->price(false, $taxedItemsOnly) * (!empty($subItem->qty) ?: 1);
$total += $subItem->price(false, $taxedItemsOnly) * (!empty($subItem->qty) ? $subItem->qty : 1);
}

if ($withTax) {
Expand Down

0 comments on commit e99ec80

Please sign in to comment.