Open TarekRamadan91 opened 6 months ago
when try to add product to card using this method
public function addProduct(Request $request) { $product = Product::findOrFail($request->product_id); $data = [ 'id' => $product->id, 'name' => $product->name, 'price' => $product->price, 'quantity' => $request->quantity, 'attributes' => [ 'image' => $product->image, ], ]; Cart::add($data); // Add the new item to the cart $cartContent = Cart::getContent(); // Retrieve the updated cart content dd($cartContent->toArray()); // Display the updated cart
and try to add another product and make
$cartContent = Cart::getContent(); // Retrieve the updated cart content dd($cartContent->toArray()); // Display the updated cart
its return last item added only not all product in cart !
when try to add product to card using this method
and try to add another product and make
its return last item added only not all product in cart !