We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ae299df + 010bb51 commit 23fa7efCopy full SHA for 23fa7ef
src/Darryldecode/Cart/Cart.php
@@ -672,7 +672,9 @@ public function getTotalQuantity()
672
*/
673
public function getContent()
674
{
675
- return (new CartCollection($this->session->get($this->sessionKeyCartItems)));
+ return (new CartCollection($this->session->get($this->sessionKeyCartItems)))->reject(function($item) {
676
+ return ! ($item instanceof ItemCollection);
677
+ });
678
}
679
680
/**
@@ -682,9 +684,7 @@ public function getContent()
682
684
683
685
public function isEmpty()
686
- $cart = new CartCollection($this->session->get($this->sessionKeyCartItems));
-
687
- return $cart->isEmpty();
+ return $this->getContent()->isEmpty();
688
689
690
0 commit comments