Skip to content

Commit

Permalink
Basket fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jirisvoboda committed Aug 4, 2015
1 parent a7568dc commit 51749ee
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/Basket.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,16 @@ public function remove(BasketItemInterface $item, $save = true)
*/
public function getCount($itemType = null)
{
return count($this->getItems($itemType));
$items = $this->getItems($itemType);

$count = 0;

foreach ($items as $item)
{
$count += $item->basketQuantity;
}

return $count;
}

/**
Expand Down

0 comments on commit 51749ee

Please sign in to comment.