dimanche 23 février 2020

save image path in cart session in laravel

I want to store product image path in session for that i'm using following code :

 $product = $this->productRepository->findProductById($request->input('productId'));
    $options = $request->except($request->input('_token'), $request->input('productId'),$request->input('productPrice'), $request->input('quantity'),$product->images[0]['full']);
    Cart::add(array('id'=>uniqid(), 'name'=>$product->name, 'price'=>$request->input('productPrice'),  'quantity'=>$request->input('quantity'),'image'=>$product->images[0]['full'], 'attributes'=>array($options)));

other details are being stored in cart but image path is not getting stored.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire