-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item not remove #129
Comments
@SknightS |
yes its the item id . its showing nothing . |
if dd doesn't give you a result, it means that the item id isn't provided, ie there's something wrong with your code. for displaying your items in the cart, you use @foreach ($cartCollection as $cart)
<tr>
<td>{{ $cart['name'] }}<td>
<td>{{ $cart['qty'] }}<td>
<td>{{ $cart['price'] }}<td>
<td><a class="btn btn-danger" href="{{ url('/remove/'.$cart['id']) }}">X</a><td>
</tr>
@endforeach in your web.php file you've to add the route: and the removeFromCart method: public function removeFromCart($id)
{
Cart::remove($id);
return back();
} that way it shouldn't be a problem to delete an item from the cart |
thanks for your help . but i did it with ajax . i pass the id with ajax and in controller i remove the item . is it the problem of ajax controller ? |
sorry, don't know how to handle ajax |
@SknightS please post your codes or you can always check the demo repo here https://github.com/darryldecode/laravelshoppingcart-demo this is ajax. |
ThankssSSS!!!!!Bro - you best! |
$cartid = $r->cartid;
// return $cartid;
Cart::remove($cartid);
i am trying like this . but item not remove from cart . what can be the issue ?
The text was updated successfully, but these errors were encountered: