Skip to content

Commit

Permalink
Merge pull request #220 from yajra/patch1
Browse files Browse the repository at this point in the history
Cast items to array.
  • Loading branch information
lukepolo authored Nov 22, 2017
2 parents 4ea689a + 89c0f1f commit ca4319b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LaraCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ public function totalDiscount($format = true, $withItemDiscounts = true)

if ($withItemDiscounts) {
/** @var CartItem $item */
foreach ($this->cart->items as $item) {
foreach ((array) $this->cart->items as $item) {
$total += floatval($item->getDiscount(false));
}
}
Expand Down

0 comments on commit ca4319b

Please sign in to comment.