Undefined index: product_id when I Add a second item to the cart. (Custom product page)
-
This post is deleted! -
Hi @Flow4all,
It's already showing that
product_id
is missing. Please check whetherproduct_id
is coming or not. -
I know the problem, but can't fix it. Why in the world is failing on second product if the first one was okey, the page showing the product is the same. if that make sense you you, any tip or advice would be highly appreciated.
-
As from the code, it's not showing any problem, I suggest you to
dd($product)
on the second product and check whetherproduct_id
is coming or not. -
I solved this in my case :
Actually as per documentation it only need $id but in sub methods bagisto is using product id from request.
Solution :
add this in the method body of store() in Cart Controller:
$request['product_id'] = $id;