Fixed Exception In Merged Cart

This commit is contained in:
Devansh 2022-05-05 16:52:45 +05:30
parent 472eb9cf46
commit c52bcb430c
1 changed files with 1 additions and 11 deletions

View File

@ -310,19 +310,9 @@ class Cart
}
foreach ($cart->items as $item) {
$this->cartItemRepository->delete($item->id);
if ($cart->items->count() == 0) {
$this->cartRepository->delete($cart->id);
if (session()->has('cart')) {
session()->forget('cart');
}
}
$this->removeItem($item->id);
}
$cart->save();
Event::dispatch('checkout.cart.delete.all.after', $cart);
return $cart;