From 259f5a8c0042b8dea771fa014a11f5d94cfde3a7 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Thu, 23 Jan 2020 19:43:03 +0530 Subject: [PATCH] Issue #2088 --- packages/Webkul/Checkout/src/Cart.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index 8b3ae7993..581dba191 100755 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -146,6 +146,10 @@ class Cart { if (is_string($cartProducts)) { $this->collectTotals(); + if (! count($cart->all_items) > 0) { + session()->forget('cart'); + } + throw new \Exception($cartProducts); } else { $parentCartItem = null; @@ -328,6 +332,8 @@ class Cart { $guestCart = session()->get('cart'); + dd($guestCart); + //when the logged in customer is not having any of the cart instance previously and are active. if (! $cart) { $this->cartRepository->update([