Merge pull request #6399 from devansh-webkul/fixed-exception

Fixed Exception In Merged Cart #6397
This commit is contained in:
Jitendra Singh 2022-05-06 10:31:26 +05:30 committed by GitHub
commit b26972f6c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;