vendredi 14 août 2020

Can someone please help me display my products from cart please?

Hi Am using Melihovv ShoppingCart. I want to display all products inside cart but I couldn't. It shows the page but the products are not displaying. Thanks for your help. Here is my code

public function store(Request $request) {

$cartItem = Cart::add($request->id, $request->name, $request->price, 1);
return view('pages.cart')->with([
    'cartItem' => $request->cartItem
    ]);
    

}

And Here is my view

@if (!empty($cartItem) && count($cartItem) > 0)
    @foreach ($cartItem as $product)
        
    @endforeach
@endif


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire