Fixed Exception In Merged Cart
This commit is contained in:
parent
472eb9cf46
commit
c52bcb430c
|
|
@ -310,19 +310,9 @@ class Cart
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($cart->items as $item) {
|
foreach ($cart->items as $item) {
|
||||||
$this->cartItemRepository->delete($item->id);
|
$this->removeItem($item->id);
|
||||||
|
|
||||||
if ($cart->items->count() == 0) {
|
|
||||||
$this->cartRepository->delete($cart->id);
|
|
||||||
|
|
||||||
if (session()->has('cart')) {
|
|
||||||
session()->forget('cart');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cart->save();
|
|
||||||
|
|
||||||
Event::dispatch('checkout.cart.delete.all.after', $cart);
|
Event::dispatch('checkout.cart.delete.all.after', $cart);
|
||||||
|
|
||||||
return $cart;
|
return $cart;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue