-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How to search/get a cart values/item with its id not rowId #408
Comments
Use the search method |
Sir, your answer is not clear to me. I already used the search method. Have close look on the code basically I need this: Thanks |
Cart::content()->where('id', $id); this code did the tricks for me... |
@wasid you saved my day man very thanks |
I also can't understand how the |
Output : Illuminate\Support\Collection Object @wasid But how to get the qty ? |
Sorry if i misunderstand the topic but using the search method is just Collection::filter, you should be able to iterate the returning collection or use first() and then be able to access the quantity as it is a public property of the CartItem class like this: LaravelShoppingcart/src/CartItem.php Line 30 in f460ab7
So out of my head something like that should work:
|
@bumbummen99, Its very simple .................. $asd = Cart::content()->where('id', $request->product_id); foreach ($asd as $row) { |
public function addCart($id)
{
$products = MarketProduct::find($id);
The text was updated successfully, but these errors were encountered: