Skip to content

Commit 010bb51

Browse files
authored
Merge pull request #1 from belguinan/belguinan-patch-1
Bug fix
2 parents ae299df + 8fd5ee5 commit 010bb51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Darryldecode/Cart/Cart.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,9 @@ public function getTotalQuantity()
672672
*/
673673
public function getContent()
674674
{
675-
return (new CartCollection($this->session->get($this->sessionKeyCartItems)));
675+
return (new CartCollection($this->session->get($this->sessionKeyCartItems)))->reject(function($item) {
676+
return ! ($item instanceof ItemCollection);
677+
});
676678
}
677679

678680
/**
@@ -682,9 +684,7 @@ public function getContent()
682684
*/
683685
public function isEmpty()
684686
{
685-
$cart = new CartCollection($this->session->get($this->sessionKeyCartItems));
686-
687-
return $cart->isEmpty();
687+
return $this->getContent()->isEmpty();
688688
}
689689

690690
/**

0 commit comments

Comments
 (0)