Skip to content

Commit

Permalink
Merge pull request darryldecode#1 from belguinan/belguinan-patch-1
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
belguinan authored May 6, 2020
2 parents ae299df + 8fd5ee5 commit 010bb51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Darryldecode/Cart/Cart.php
Original file line number Diff line number Diff line change
@@ -672,7 +672,9 @@ public function getTotalQuantity()
*/
public function getContent()
{
return (new CartCollection($this->session->get($this->sessionKeyCartItems)));
return (new CartCollection($this->session->get($this->sessionKeyCartItems)))->reject(function($item) {
return ! ($item instanceof ItemCollection);
});
}

/**
@@ -682,9 +684,7 @@ public function getContent()
*/
public function isEmpty()
{
$cart = new CartCollection($this->session->get($this->sessionKeyCartItems));

return $cart->isEmpty();
return $this->getContent()->isEmpty();
}

/**

0 comments on commit 010bb51

Please sign in to comment.