fix: 🐛 error on removeFromCart

This commit is contained in:
Karl 2025-07-01 15:44:02 +02:00
parent 3ede971217
commit dc8fa4da0b

View file

@ -58,7 +58,9 @@ class BasketController extends Controller
$rowId = $request->rowId;
Cart::instance($instance);
try {
Cart::remove($rowId);
if (Cart::content()->get($rowId)) {
Cart::remove($rowId);
}
} catch (\Gloudemans\Shoppingcart\Exceptions\InvalidRowIDException $e) {
// Attempted to remove a Row which is not in cart anymore.
report($e);