Open gagsy opened 4 years ago
It's very easy. You only need use the method remove($rowId) passing the product's rowId as a parameter:
remove($rowId)
Cart::remove('productRowId');
To get the product's rowId, you can use Cart::search() and compare any property from $cartItem:
Cart::search()
$cartItem
$rowId = $cart->search(function ($cartItem, $rowId) { return $cartItem->id === 1; }); // The return will be the product's rowId
It's very easy. You only need use the method
remove($rowId)
passing the product's rowId as a parameter:Cart::remove('productRowId');
To get the product's rowId, you can use
Cart::search()
and compare any property from$cartItem
: