-
Notifications
You must be signed in to change notification settings - Fork 479
Open
Description
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 !
Metadata
Metadata
Assignees
Labels
No labels